|
22 | 22 |
|
23 | 23 | <!-- Custom admonition icons -->
|
24 | 24 | {% if config.theme.icon.admonition %}
|
25 |
| - {% set _ = namespace(style = "\x3cstyle\x3e:root{") %} |
| 25 | + {% set _ = namespace(style = "\u003cstyle\u003e:root{") %} |
26 | 26 | {% for type, icon in config.theme.icon.admonition | items %}
|
27 |
| - {% import ".icons/" ~ icon ~ ".svg" as icon %} |
28 |
| - {% set _.style = _.style ~ |
29 |
| - "--md-admonition-icon--" ~ type ~ ":" ~ |
30 |
| - "url('data:image/svg+xml;charset=utf-8," ~ |
31 |
| - icon | replace("\n", "") | urlencode ~ |
32 |
| - "');" |
33 |
| - %} |
| 27 | + {% if type and icon %} |
| 28 | + {% import ".icons/" ~ icon ~ ".svg" as icon %} |
| 29 | + {% set _.style = _.style ~ |
| 30 | + "--md-admonition-icon--" ~ type ~ ":" ~ |
| 31 | + "url('data:image/svg+xml;charset=utf-8," ~ |
| 32 | + icon | replace("\n", "") | urlencode ~ |
| 33 | + "');" |
| 34 | + %} |
| 35 | + {% endif %} |
34 | 36 | {% endfor %}
|
35 |
| - {% set _.style = _.style ~ "}\x3c/style\x3e" %} |
| 37 | + {% set _.style = _.style ~ "}\u003c/style\u003e" %} |
36 | 38 | {{ _.style }}
|
37 | 39 | {% endif %}
|
38 | 40 |
|
39 | 41 | <!-- Custom annotation icon -->
|
40 | 42 | {% if config.theme.icon.annotation %}
|
41 |
| - {% set _ = namespace(style = "\x3cstyle\x3e:root{") %} |
| 43 | + {% set _ = namespace(style = "\u003cstyle\u003e:root{") %} |
42 | 44 | {% import ".icons/" ~ config.theme.icon.annotation ~ ".svg" as icon %}
|
43 | 45 | {% set _.style = _.style ~
|
44 | 46 | "--md-annotation-icon:" ~
|
45 | 47 | "url('data:image/svg+xml;charset=utf-8," ~
|
46 | 48 | icon | replace("\n", "") | urlencode ~
|
47 | 49 | "');"
|
48 | 50 | %}
|
49 |
| - {% set _.style = _.style ~ "}\x3c/style\x3e" %} |
| 51 | + {% set _.style = _.style ~ "}\u003c/style\u003e" %} |
50 | 52 | {{ _.style }}
|
51 | 53 | {% endif %}
|
52 | 54 |
|
53 | 55 | <!-- Custom tag icons -->
|
54 | 56 | {% if config.theme.icon.tag %}
|
55 |
| - {% set _ = namespace(style = "\x3cstyle\x3e:root{") %} |
| 57 | + {% set _ = namespace(style = "\u003cstyle\u003e:root{") %} |
56 | 58 | {% for type, icon in config.theme.icon.tag | items %}
|
57 |
| - {% import ".icons/" ~ icon ~ ".svg" as icon %} |
58 |
| - {% if type != "default" %} |
59 |
| - {% set modifier = ".md-tag--" ~ type %} |
| 59 | + {% if type and icon %} |
| 60 | + {% import ".icons/" ~ icon ~ ".svg" as icon %} |
| 61 | + {% if type != "default" %} |
| 62 | + {% set modifier = ".md-tag--" ~ type %} |
| 63 | + {% endif %} |
| 64 | + {% set _.style = _.style ~ |
| 65 | + ".md-tag" ~ modifier ~ "{" ~ |
| 66 | + "--md-tag-icon:" ~ |
| 67 | + "url('data:image/svg+xml;charset=utf-8," ~ |
| 68 | + icon | replace("\n", "") | urlencode ~ |
| 69 | + "');" ~ |
| 70 | + "}" |
| 71 | + %} |
60 | 72 | {% endif %}
|
61 |
| - {% set _.style = _.style ~ |
62 |
| - ".md-tag" ~ modifier ~ "{" ~ |
63 |
| - "--md-tag-icon:" ~ |
64 |
| - "url('data:image/svg+xml;charset=utf-8," ~ |
65 |
| - icon | replace("\n", "") | urlencode ~ |
66 |
| - "');" ~ |
67 |
| - "}" |
68 |
| - %} |
69 | 73 | {% endfor %}
|
70 |
| - {% set _.style = _.style ~ "}\x3c/style\x3e" %} |
| 74 | + {% set _.style = _.style ~ "}\u003c/style\u003e" %} |
71 | 75 | {{ _.style }}
|
72 | 76 | {% endif %}
|
0 commit comments