Skip to content

Commit

Permalink
Fixed rendering of tags in search
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Sep 22, 2024
1 parent 43a22b6 commit 06fe18a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion material/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
</script>
{% endblock %}
{% 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 %}
{{ script | script_tag }}
{% endfor %}
Expand Down
24 changes: 14 additions & 10 deletions src/templates/assets/javascripts/templates/search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,20 @@ function renderSearchDocument(
{teaser > 0 && document.text.length > 0 &&
document.text
}
{document.tags && document.tags.map(tag => {
const type = tags
? tag in tags
? `md-tag-icon md-tag--${tags[tag]}`
: "md-tag-icon"
: ""
return (
<span class={`md-tag ${type}`}>{tag}</span>
)
})}
{document.tags && (
<nav class="md-tags">
{document.tags.map(tag => {
const type = tags
? tag in tags
? `md-tag-icon md-tag--${tags[tag]}`
: "md-tag-icon"
: ""
return (
<span class={`md-tag ${type}`}>{tag}</span>
)
})}
</nav>
)}
{teaser > 0 && missing.length > 0 &&
<p class="md-search-result__terms">
{translation("search.result.term.missing")}: {...missing}
Expand Down

0 comments on commit 06fe18a

Please sign in to comment.