site/layouts/partials/header.html

25 lines
697 B
HTML

{{ $home := .Site.Title -}}
{{ if (ne .RelPermalink "/") -}}
{{ $home = .Site.Title -}}
{{ if .Site.Params.navHomeUsePFPName -}}
{{ $home = partial "pfp-name.html" . -}}
{{ end -}}
{{ end -}}
<nav>
<strong><a title="home" id="home" href="{{ .Site.BaseURL }}">{{ $home }}</a></strong>
<ul>
{{- $currentPage := . }}
{{- range .Site.Menus.main.ByWeight }}
{{- $url := printf "%s%s" $.Site.BaseURL .URL }}
{{- .Pre }}
<li>
<a href="{{ $url }}"
{{- if hasPrefix $currentPage.RelPermalink .URL }}class="selected"{{ end -}}
title="{{ .Title }}">{{- .Name -}}</a>
</li>
{{ .Post -}}
{{- end }}
</ul>
</nav>