Move site navigation to a partial
It can now be shared between the index and site header templates.
This commit is contained in:
parent
52a79500c0
commit
1713d5f849
4 changed files with 11 additions and 19 deletions
|
@ -158,8 +158,6 @@
|
||||||
font-size: clamp(var(--font-size-min), var(--font-size-scale-factor), var(--font-size-max));
|
font-size: clamp(var(--font-size-min), var(--font-size-scale-factor), var(--font-size-max));
|
||||||
}
|
}
|
||||||
|
|
||||||
main#landing p { line-height: var(--landing-line-height); }
|
|
||||||
|
|
||||||
nav.bulleted > li:first-child::before { color: var(--color); }
|
nav.bulleted > li:first-child::before { color: var(--color); }
|
||||||
nav.bulleted > li::before { color: var(--heading-color); }
|
nav.bulleted > li::before { color: var(--heading-color); }
|
||||||
|
|
||||||
|
|
|
@ -5,14 +5,5 @@
|
||||||
<div id="content">
|
<div id="content">
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
</div>
|
</div>
|
||||||
{{- with site.Menus.main -}}
|
{{ partial "site_nav.html" . }}
|
||||||
{{- $url := $.RelPermalink -}}
|
|
||||||
<nav class="site bulleted">
|
|
||||||
{{- range . -}}
|
|
||||||
<li><a class="{{ if eq .URL $url }}active{{ end }}" href="{{ .URL }}"><span>{{ i18n .Identifier | default .Name }}</span></a></li>
|
|
||||||
{{- end -}}
|
|
||||||
</nav>
|
|
||||||
{{ end }}
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -5,13 +5,7 @@
|
||||||
<h1 class="site">
|
<h1 class="site">
|
||||||
<a class="site-name" href="{{ `` | absURL }}">{{ partial "site_name.html" site.Params.shortTitle }}</a>
|
<a class="site-name" href="{{ `` | absURL }}">{{ partial "site_name.html" site.Params.shortTitle }}</a>
|
||||||
</h1>
|
</h1>
|
||||||
<nav class="site bulleted">
|
{{ partial "site_nav.html" . }}
|
||||||
{{ with site.Menus.main }}
|
|
||||||
{{- range . -}}
|
|
||||||
<li><a {{ if $currentPage.HasMenuCurrent "main" . }} class="active"{{ end }} href="{{ .URL }}"><span>{{ .Name }}</span></a></li>
|
|
||||||
{{- end -}}
|
|
||||||
{{ end }}
|
|
||||||
</nav>
|
|
||||||
<nav class="social">
|
<nav class="social">
|
||||||
{{ with site.Menus.social }}
|
{{ with site.Menus.social }}
|
||||||
{{- range . -}}
|
{{- range . -}}
|
||||||
|
|
9
layouts/partials/site_nav.html
Normal file
9
layouts/partials/site_nav.html
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{{- $currentPage := . -}}
|
||||||
|
{{- $url := $.RelPermalink -}}
|
||||||
|
<nav class="site bulleted">
|
||||||
|
{{ with site.Menus.main }}
|
||||||
|
{{- range . -}}
|
||||||
|
<li><a {{ if $currentPage.HasMenuCurrent "main" . }} class="active"{{ end }} href="{{ .URL }}"><span>{{ .Name }}</span></a></li>
|
||||||
|
{{- end -}}
|
||||||
|
{{ end }}
|
||||||
|
</nav>
|
Loading…
Add table
Add a link
Reference in a new issue