Add ability to load more partials in header without copying it
Hello, It would be great to have these small improvements, so we don't have to change upstream (PaperMod) files.
This commit is contained in:
parent
5a99ab779d
commit
9b794f661f
@ -40,6 +40,9 @@
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
<header class="header">
|
<header class="header">
|
||||||
|
{{ if templates.Exists "partials/extend_header_before.html" }}
|
||||||
|
{{- partial "extend_header_before.html" . -}}
|
||||||
|
{{ end }}
|
||||||
<nav class="nav">
|
<nav class="nav">
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
{{- $label_text := (site.Params.label.text | default site.Title) }}
|
{{- $label_text := (site.Params.label.text | default site.Title) }}
|
||||||
@ -121,6 +124,9 @@
|
|||||||
</div>
|
</div>
|
||||||
{{- $currentPage := . }}
|
{{- $currentPage := . }}
|
||||||
<ul id="menu">
|
<ul id="menu">
|
||||||
|
{{ if templates.Exists "partials/extend_header_menu_items_before.html" }}
|
||||||
|
{{- partial "extend_header_menu_items_before.html" . -}}
|
||||||
|
{{ end }}
|
||||||
{{- range site.Menus.main }}
|
{{- range site.Menus.main }}
|
||||||
{{- $menu_item_url := (cond (strings.HasSuffix .URL "/") .URL (printf "%s/" .URL) ) | absLangURL }}
|
{{- $menu_item_url := (cond (strings.HasSuffix .URL "/") .URL (printf "%s/" .URL) ) | absLangURL }}
|
||||||
{{- $page_url:= $currentPage.Permalink | absLangURL }}
|
{{- $page_url:= $currentPage.Permalink | absLangURL }}
|
||||||
@ -144,6 +150,12 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{ if templates.Exists "partials/extend_header_menu_items_after.html" }}
|
||||||
|
{{- partial "extend_header_menu_items_after.html" . -}}
|
||||||
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
{{ if templates.Exists "partials/extend_header_after.html" }}
|
||||||
|
{{- partial "extend_header_after.html" . -}}
|
||||||
|
{{ end }}
|
||||||
</header>
|
</header>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user