diff --git a/layouts/w/single.html b/layouts/w/single.html index 2a02ad78f..af8b2eba2 100644 --- a/layouts/w/single.html +++ b/layouts/w/single.html @@ -259,7 +259,23 @@

{{.Title}}

{{ else }} {{ $openerHash = partialCached "first-guess-hash" . .Title }} {{ end }} -

Opener Hash: {{ $openerHash }}

+{{ $openerHashKey := printf "%s" $openerHash }} +{{ $openerHashCount := 0 }} +{{ $openerHashOccurrence := 0 }} +{{ with (index $.Site.Taxonomies.openerhashes $openerHashKey) }} + {{ $openerHashCount = len .Pages }} + {{ range $i, $page := .Pages.ByDate }} + {{ if eq $page.RelPermalink $.RelPermalink }} + {{ $openerHashOccurrence = add $i 1 }} + {{ end }} + {{ end }} +{{ end }} +{{ $openerHashLabel := $openerHashKey }} +{{ if gt $openerHashCount 0 }} + {{ $occurrenceLabel := cond (gt $openerHashOccurrence 0) (printf "%d" $openerHashOccurrence) "?" }} + {{ $openerHashLabel = printf "%s (%s/%d)" $openerHashKey $occurrenceLabel $openerHashCount }} +{{ end }} +

Opener Hash: {{ $openerHashLabel }}

{{ with .Params.shifts }} {{ $shift := (index . 0) }}

Shift: {{ $shift }}