1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-12 01:50:52 +01:00

Fixed rendering of tags in search

This commit is contained in:
squidfunk 2024-09-22 12:10:08 +02:00
parent 43a22b6150
commit 06fe18af7e
No known key found for this signature in database
GPG Key ID: 5ED40BC4F9C436DF
4 changed files with 19 additions and 15 deletions

View File

@ -249,7 +249,7 @@
</script> </script>
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}
<script src="{{ 'assets/javascripts/bundle.56dfad97.min.js' | url }}"></script> <script src="{{ 'assets/javascripts/bundle.d6f25eb3.min.js' | url }}"></script>
{% for script in config.extra_javascript %} {% for script in config.extra_javascript %}
{{ script | script_tag }} {{ script | script_tag }}
{% endfor %} {% endfor %}

View File

@ -88,7 +88,9 @@ function renderSearchDocument(
{teaser > 0 && document.text.length > 0 && {teaser > 0 && document.text.length > 0 &&
document.text document.text
} }
{document.tags && document.tags.map(tag => { {document.tags && (
<nav class="md-tags">
{document.tags.map(tag => {
const type = tags const type = tags
? tag in tags ? tag in tags
? `md-tag-icon md-tag--${tags[tag]}` ? `md-tag-icon md-tag--${tags[tag]}`
@ -98,6 +100,8 @@ function renderSearchDocument(
<span class={`md-tag ${type}`}>{tag}</span> <span class={`md-tag ${type}`}>{tag}</span>
) )
})} })}
</nav>
)}
{teaser > 0 && missing.length > 0 && {teaser > 0 && missing.length > 0 &&
<p class="md-search-result__terms"> <p class="md-search-result__terms">
{translation("search.result.term.missing")}: {...missing} {translation("search.result.term.missing")}: {...missing}