Allow for personalized titles for Blog and Note pages (#951)

This commit is contained in:
Andrea Maiani 2024-07-30 23:21:29 +02:00 committed by GitHub
parent 05dce9c509
commit d0329531d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,8 @@
{{/* variables for enabling/disabling various features */}} {{/* variables for enabling/disabling various features */}}
{{ $blogEnabled := site.Params.features.blog.enable | default false }} {{ $blogEnabled := site.Params.features.blog.enable | default false }}
{{ $blogTitle := site.Params.features.blog.title | default (i18n "posts") }}
{{ $notesEnabled := site.Params.features.notes.enable | default false }} {{ $notesEnabled := site.Params.features.notes.enable | default false }}
{{ $notesTitle := site.Params.features.notes.title | default (i18n "notes") }}
{{ $maxVisibleSections := site.Params.topNavbar.maxVisibleSections | default 5 }} {{ $maxVisibleSections := site.Params.topNavbar.maxVisibleSections | default 5 }}
{{/* keep backward compatibility for blog post */}} {{/* keep backward compatibility for blog post */}}
@ -121,12 +123,12 @@
{{ end }} {{ end }}
{{ if $blogEnabled }} {{ if $blogEnabled }}
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" id="blog-link" href="{{ path.Join (site.BaseURL | relLangURL) "posts" }}">{{ i18n "posts" }}</a> <a class="nav-link" id="blog-link" href="{{ path.Join (site.BaseURL | relLangURL) "posts" }}">{{ $blogTitle }}</a>
</li> </li>
{{ end }} {{ end }}
{{ if $notesEnabled }} {{ if $notesEnabled }}
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" id="note-link" href="{{ path.Join (site.BaseURL | relLangURL) "notes" }}">{{ i18n "notes" }}</a> <a class="nav-link" id="note-link" href="{{ path.Join (site.BaseURL | relLangURL) "notes" }}">{{ $notesTitle }}</a>
</li> </li>
{{ end }} {{ end }}
{{ range $customMenus }} {{ range $customMenus }}