feat: add option geekblogTagsToMenu (#73)

Co-authored-by: Giovanni Ciatto <giovanni.ciatto@unibo.it>
This commit is contained in:
Robert Kaussow 2021-07-06 23:25:30 +02:00 committed by GitHub
parent 171feac082
commit ea976beeaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 0 deletions

View File

@ -84,3 +84,4 @@ params:
geekblogPrivacyPolicy: https://thegeeklab.de/legal-notice/#privacy-policy geekblogPrivacyPolicy: https://thegeeklab.de/legal-notice/#privacy-policy
geekblogImageLazyLoading: true geekblogImageLazyLoading: true
geekblogTagsToMenu: true

View File

@ -253,6 +253,9 @@ enableGitInfo = true
# See https://developer.mozilla.org/de/docs/Web/HTML/Element/base. # See https://developer.mozilla.org/de/docs/Web/HTML/Element/base.
geekblogOverwriteHTMLBase = false 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. # (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. # Could be used if you want to give credits to your hosting provider.
[params.geekblogHostedOn] [params.geekblogHostedOn]

View File

@ -22,6 +22,7 @@
</div> </div>
<ul class="gblog-nav__list container flex flex-wrap justify-center menu-content"> <ul class="gblog-nav__list container flex flex-wrap justify-center menu-content">
{{ $currentPage := .RelPermalink }} {{ $currentPage := .RelPermalink }}
{{ if default true .Site.Params.GeekblogTagsToMenu }}
{{ range $name, $taxonomy := .Site.Taxonomies.tags }} {{ range $name, $taxonomy := .Site.Taxonomies.tags }}
{{ with $.Site.GetPage (printf "/tags/%s" $name) }} {{ with $.Site.GetPage (printf "/tags/%s" $name) }}
<li> <li>
@ -29,6 +30,7 @@
</li> </li>
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ end }}
{{ if .Site.Data.menu.extra.header }} {{ if .Site.Data.menu.extra.header }}
{{ partial "menu-extra" (dict "current" . "source" .Site.Data.menu.extra.header "target" "header") }} {{ partial "menu-extra" (dict "current" . "source" .Site.Data.menu.extra.header "target" "header") }}
{{ end }} {{ end }}