mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-24 07:30:12 +01:00
Refactored tag modifier implementation
This commit is contained in:
parent
0f74615dc9
commit
4d7291f25e
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -240,7 +240,7 @@
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
<script src="{{ 'assets/javascripts/bundle.2a6f1dda.min.js' | url }}"></script>
|
||||
<script src="{{ 'assets/javascripts/bundle.3e1761d0.min.js' | url }}"></script>
|
||||
{% for path in config.extra_javascript %}
|
||||
<script src="{{ path | url }}"></script>
|
||||
{% endfor %}
|
||||
|
@ -23,7 +23,7 @@
|
||||
{% set modifier = "--" ~ type %}
|
||||
{% endif %}
|
||||
{% set _ = style.append(
|
||||
".md-tag-icon" ~ modifier ~ "{" ~
|
||||
".md-tag" ~ modifier ~ "{" ~
|
||||
"--md-tag-icon:" ~
|
||||
"url('data:image/svg+xml;charset=utf-8," ~
|
||||
icon | replace("\n", "") ~
|
||||
|
@ -10,7 +10,7 @@
|
||||
{% if config.extra.tags %}
|
||||
{% set icon = " md-tag-icon" %}
|
||||
{% if tag.type %}
|
||||
{% set icon = icon ~ " md-tag-icon--" ~ tag.type %}
|
||||
{% set icon = icon ~ " md-tag--" ~ tag.type %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if tag.url %}
|
||||
|
@ -116,7 +116,7 @@ class TagsPlugin(BasePlugin[TagsPluginConfig]):
|
||||
classes.append("md-tag-icon")
|
||||
type = self.tags_map.get(tag)
|
||||
if type:
|
||||
classes.append(f"md-tag-icon--{type}")
|
||||
classes.append(f"md-tag--{type}")
|
||||
|
||||
# Render section for tag and a link to each page
|
||||
classes = " ".join(classes)
|
||||
|
@ -90,7 +90,7 @@ function renderSearchDocument(
|
||||
{document.tags && document.tags.map(tag => {
|
||||
const type = tags
|
||||
? tag in tags
|
||||
? `md-tag-icon md-tag-icon--${tags[tag]}`
|
||||
? `md-tag-icon md-tag--${tags[tag]}`
|
||||
: "md-tag-icon"
|
||||
: ""
|
||||
return (
|
||||
|
@ -45,7 +45,7 @@
|
||||
{% set modifier = "--" ~ type %}
|
||||
{% endif %}
|
||||
{% set _ = style.append(
|
||||
".md-tag-icon" ~ modifier ~ "{" ~
|
||||
".md-tag" ~ modifier ~ "{" ~
|
||||
"--md-tag-icon:" ~
|
||||
"url('data:image/svg+xml;charset=utf-8," ~
|
||||
icon | replace("\n", "") ~
|
||||
|
@ -32,7 +32,7 @@
|
||||
{% if config.extra.tags %}
|
||||
{% set icon = " md-tag-icon" %}
|
||||
{% if tag.type %}
|
||||
{% set icon = icon ~ " md-tag-icon--" ~ tag.type %}
|
||||
{% set icon = icon ~ " md-tag--" ~ tag.type %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
|
@ -116,7 +116,7 @@ class TagsPlugin(BasePlugin[TagsPluginConfig]):
|
||||
classes.append("md-tag-icon")
|
||||
type = self.tags_map.get(tag)
|
||||
if type:
|
||||
classes.append(f"md-tag-icon--{type}")
|
||||
classes.append(f"md-tag--{type}")
|
||||
|
||||
# Render section for tag and a link to each page
|
||||
classes = " ".join(classes)
|
||||
|
Loading…
Reference in New Issue
Block a user