2020-01-12 15:33:02 +01:00
|
|
|
{{ $geekdocRepo := default (default false .Site.Params.GeekdocRepo) .Page.Params.GeekdocRepo }}
|
|
|
|
{{ $geekdocEditPath := default (default false .Site.Params.GeekdocEditPath) .Page.Params.GeekdocEditPath }}
|
|
|
|
{{ if .File }}
|
2020-11-11 11:48:25 +01:00
|
|
|
{{ $.Scratch.Set "geekdocFilePath" (default .File.Path .Page.Params.GeekdocFilePath) }}
|
2020-01-12 15:33:02 +01:00
|
|
|
{{ else }}
|
|
|
|
{{ $.Scratch.Set "geekdocFilePath" false }}
|
|
|
|
{{ end }}
|
|
|
|
|
2020-02-05 09:40:05 +01:00
|
|
|
{{ define "breadcrumb" }}
|
2020-02-16 23:17:45 +01:00
|
|
|
{{ $parent := .page.Parent }}
|
2020-01-12 15:33:02 +01:00
|
|
|
{{ if $parent }}
|
2020-02-16 23:17:45 +01:00
|
|
|
{{ $name := (partial "title" $parent) }}
|
2021-02-20 22:54:49 +01:00
|
|
|
{{ $position := (sub .position 1) }}
|
|
|
|
{{ $value := (printf "<li itemprop='itemListElement' itemscope itemtype='https://schema.org/ListItem'><a itemscope itemtype='https://schema.org/WebPage' itemprop='item' itemid='%s' href='%s'><span itemprop='name'>%s</span></a><meta itemprop='position' content='%d' /></li><li> / </li>%s" $parent.RelPermalink $parent.RelPermalink $name $position .value) }}
|
|
|
|
{{ template "breadcrumb" dict "page" $parent "value" $value "position" $position }}
|
2020-02-05 09:40:05 +01:00
|
|
|
{{ else }}
|
|
|
|
{{ .value | safeHTML }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
2020-01-12 15:33:02 +01:00
|
|
|
|
2020-02-27 00:08:00 +01:00
|
|
|
{{ $showBreadcrumb := (and (default true .Page.Params.GeekdocBreadcrumb) (default true .Site.Params.GeekdocBreadcrumb)) }}
|
2020-02-05 10:13:04 +01:00
|
|
|
{{ $showEdit := (and ($.Scratch.Get "geekdocFilePath") $geekdocRepo $geekdocEditPath) }}
|
2021-02-20 22:54:49 +01:00
|
|
|
<div class="gdoc-page__header flex flex-wrap
|
|
|
|
{{ if $showBreadcrumb }} justify-between {{ else }} justify-end {{ end }}
|
|
|
|
{{ if not $showEdit }} hidden-mobile {{ end }}
|
|
|
|
{{ if (and (not $showBreadcrumb) (not $showEdit)) }} hidden {{ end }}" itemprop="breadcrumb">
|
|
|
|
{{if $showBreadcrumb }}
|
|
|
|
<div>
|
2021-03-03 21:07:59 +01:00
|
|
|
<svg class="icon gdoc_path hidden-mobile"><use xlink:href="#gdoc_path"></use></svg>
|
2021-02-20 22:54:49 +01:00
|
|
|
<ol class="breadcrumb" itemscope itemtype="https://schema.org/BreadcrumbList">
|
|
|
|
{{ $position := sub (len (split .RelPermalink "/")) 1 }}
|
2020-11-09 22:06:06 +01:00
|
|
|
{{ $name := (partial "title" .) }}
|
2021-02-20 22:54:49 +01:00
|
|
|
{{ $value := (printf "<li itemprop='itemListElement' itemscope itemtype='https://schema.org/ListItem'><span itemprop='name'>%s</span><meta itemprop='position' content='%d' /></li>" $name $position ) }}
|
|
|
|
{{ template "breadcrumb" dict "page" . "value" $value "position" $position }}
|
|
|
|
</ol>
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
|
|
|
{{ if $showEdit }}
|
|
|
|
<div>
|
2020-11-09 22:06:06 +01:00
|
|
|
<span class="editpage">
|
2021-03-03 21:07:59 +01:00
|
|
|
<svg class="icon gdoc_code"><use xlink:href="#gdoc_code"></use></svg>
|
2020-01-12 15:33:02 +01:00
|
|
|
<a href="{{ $geekdocRepo }}/{{ $geekdocEditPath }}/{{ $.Scratch.Get "geekdocFilePath" }}">
|
|
|
|
Edit this page
|
|
|
|
</a>
|
2020-11-09 22:06:06 +01:00
|
|
|
</span>
|
2021-02-20 22:54:49 +01:00
|
|
|
</div>
|
|
|
|
{{ end }}
|
2020-01-12 15:33:02 +01:00
|
|
|
</div>
|