Skip to content

Commit

Permalink
Implement LinkTitle in menus, making it easy to set in frontmatter.
Browse files Browse the repository at this point in the history
  • Loading branch information
frjo committed Feb 25, 2024
1 parent 18e40b4 commit 608936b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion assets/sass/_zen.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ figcaption {
// Apply heading font stack and colour to labels etc.

th,
nav,
label,
legend,
.main-menu,
.header,
.footer {
color: var(--color-headings);
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
{{ with .File }}{{ $currentID = .UniqueID }}{{ end -}}
{{ with site.Home }}<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} aria-current="page"{{ end }}>{{ i18n "menu_home" }}</a></li>{{ end }}
{{ range where site.RegularPages "Section" "" -}}
<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} aria-current="page"{{ end }}>{{ .Title }}</a></li>
<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} aria-current="page"{{ end }}>{{ .LinkTitle }}</a></li>
{{ end -}}
{{ range site.Sections -}}
<li><a href="{{ .RelPermalink }}"{{ if eq $currentSection .Section }} aria-current="page"{{ end }}>{{ .Title }}</a></li>
<li><a href="{{ .RelPermalink }}"{{ if eq $currentSection .Section }} aria-current="page"{{ end }}>{{ .LinkTitle }}</a></li>
{{ end -}}

{{ end -}}
Expand Down
4 changes: 2 additions & 2 deletions layouts/partials/mobilemenu.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
{{ with .File }}{{ $currentID = .UniqueID }}{{ end -}}
{{ with site.Home }}<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} aria-current="page"{{ end }}>{{ i18n "menu_home" }}</a></li>{{ end }}
{{ range where site.RegularPages "Section" "" -}}
<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} aria-current="page"{{ end }}>{{ .Title }}</a></li>
<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} aria-current="page"{{ end }}>{{ .LinkTitle }}</a></li>
{{ end -}}
{{ range site.Sections -}}
<li><a href="{{ .RelPermalink }}"{{ if eq $currentSection .Section }} aria-current="page"{{ end }}>{{ .Title }}</a></li>
<li><a href="{{ .RelPermalink }}"{{ if eq $currentSection .Section }} aria-current="page"{{ end }}>{{ .LinkTitle }}</a></li>
{{ end -}}

{{ end -}}
Expand Down
8 changes: 4 additions & 4 deletions layouts/partials/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
{{ with .File }}{{ $currentID = .UniqueID }}{{ end -}}
<aside class="sidebar layout__second-sidebar">
{{ range site.Sections -}}
<section class="menu">
<p class="title"><strong><a href="{{ .RelPermalink }}"{{ if eq $currentSection .Section }} aria-current="page"{{ end }}>{{ .Title }}</a></strong></p>
<nav class="menu">
<p class="title"><strong><a href="{{ .RelPermalink }}"{{ if eq $currentSection .Section }} aria-current="page"{{ end }}>{{ .LinkTitle }}</a></strong></p>
<ul>
{{ range .Pages -}}
<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} aria-current="page"{{ end }}>{{ .Title }}</a></li>
<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} aria-current="page"{{ end }}>{{ .LinkTitle }}</a></li>
{{ end -}}
</ul>
</section>
</nav>
{{ end -}}
</aside>

0 comments on commit 608936b

Please sign in to comment.