diff --git a/assets/scripts/pages/search.js b/assets/scripts/pages/search.js index cd5eb080c..87cd0c53e 100644 --- a/assets/scripts/pages/search.js +++ b/assets/scripts/pages/search.js @@ -79,6 +79,13 @@ window.addEventListener('DOMContentLoaded', () => { // pull template from hugo template definition const templateDefinition = document.getElementById('search-result-template').innerHTML // replace values + function adaptTags() { + const tags = value.item.tags; + let string = ''; + if (tags) tags.forEach((t) => {string += '
  • ' + t + "
  • "}); + return string; + } + const output = render(templateDefinition, { key, title: value.item.title, @@ -86,7 +93,7 @@ window.addEventListener('DOMContentLoaded', () => { date: value.item.date, summary: value.item.summary, link: value.item.permalink, - tags: value.item.tags, + tags: adaptTags(), categories: value.item.categories, snippet }) diff --git a/layouts/_default/search.html b/layouts/_default/search.html index 75aad9829..5877e7ddd 100644 --- a/layouts/_default/search.html +++ b/layouts/_default/search.html @@ -28,28 +28,40 @@ {{ end }} {{ define "content" }} +
    -
    +