diff options
author | Robert Kaussow <mail@geeklabor.de> | 2021-07-07 00:25:30 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-07 00:25:30 +0300 |
commit | ea976beeaff527d2fd2fbcb1cb7242126e1aa007 (patch) | |
tree | 7e882d3fcea5d8c4fa1c9defbc1a49e2c25ff942 | |
parent | 171feac082be2b258838538ea2a0849a8cd317e9 (diff) |
feat: add option geekblogTagsToMenu (#73)v0.11.0
Co-authored-by: Giovanni Ciatto <giovanni.ciatto@unibo.it>
-rw-r--r-- | exampleSite/config.yml | 1 | ||||
-rw-r--r-- | exampleSite/content/posts/getting-started.md | 3 | ||||
-rw-r--r-- | layouts/partials/site-header.html | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/exampleSite/config.yml b/exampleSite/config.yml index 9b29d81..f1e3e51 100644 --- a/exampleSite/config.yml +++ b/exampleSite/config.yml @@ -84,3 +84,4 @@ params: geekblogPrivacyPolicy: https://thegeeklab.de/legal-notice/#privacy-policy geekblogImageLazyLoading: true + geekblogTagsToMenu: true diff --git a/exampleSite/content/posts/getting-started.md b/exampleSite/content/posts/getting-started.md index 35b5d76..27b446e 100644 --- a/exampleSite/content/posts/getting-started.md +++ b/exampleSite/content/posts/getting-started.md @@ -253,6 +253,9 @@ enableGitInfo = true # See https://developer.mozilla.org/de/docs/Web/HTML/Element/base. geekblogOverwriteHTMLBase = false + # (Optional, default true) Enable or disable adding tags automatically to the main menu. + geekblogTagsToMenu = true + # (Optional, default none) Adds a "Hosted on <provider>" line to the footer. # Could be used if you want to give credits to your hosting provider. [params.geekblogHostedOn] diff --git a/layouts/partials/site-header.html b/layouts/partials/site-header.html index f029b73..12e8a18 100644 --- a/layouts/partials/site-header.html +++ b/layouts/partials/site-header.html @@ -22,6 +22,7 @@ </div> <ul class="gblog-nav__list container flex flex-wrap justify-center menu-content"> {{ $currentPage := .RelPermalink }} + {{ if default true .Site.Params.GeekblogTagsToMenu }} {{ range $name, $taxonomy := .Site.Taxonomies.tags }} {{ with $.Site.GetPage (printf "/tags/%s" $name) }} <li> @@ -29,6 +30,7 @@ </li> {{ end }} {{ end }} + {{ end }} {{ if .Site.Data.menu.extra.header }} {{ partial "menu-extra" (dict "current" . "source" .Site.Data.menu.extra.header "target" "header") }} {{ end }} |