sitemap for every listing...
This commit is contained in:
parent
c543664ef5
commit
58e651e831
2 changed files with 27 additions and 8 deletions
|
@ -670,6 +670,10 @@ details {
|
|||
padding-right: 1rem;
|
||||
}
|
||||
|
||||
.sitemap {
|
||||
padding-left: 3rem;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
html {
|
||||
box-sizing: border-box;
|
||||
|
|
|
@ -1,11 +1,26 @@
|
|||
{{ define "singlebody" }}
|
||||
<div class="coretitle"><span class="supt">Sitemap⁄{{ substr $.Site.Title 0 1 }}</span>{{ substr $.Site.Title 1 }}</div>
|
||||
{{ $s := partialCached "scratch.html" . }}
|
||||
{{ range $p := .Site.Pages }}
|
||||
{{ $scratch := $s.Get (printf "/%s" .File) }}
|
||||
<div>{{ . }}: {{ .Title }}</div>
|
||||
{{ with ($scratch.depth) }}
|
||||
<div>Depth: {{ . }}
|
||||
{{ $noTriad := (slice) }}
|
||||
{{ range $p := .Site.RegularPages }}
|
||||
{{ $scratch := $s.Get (printf "/%s" $p.File) }}
|
||||
{{ if eq $scratch.depth "core" }}
|
||||
<div class="sitemap"><a href="{{- $p.RelPermalink -}}{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}"{{- with $p.Title}} title="{{- $p.Title -}}"{{- end -}}><span class="sup">{{- substr $p.File.Dir 0 -1 -}}⁄</span>{{- $p.Title -}}</a>
|
||||
{{ range $coreKid := $scratch.has_children }}
|
||||
<div class="sitemap"><a href="{{- $coreKid.RelPermalink -}}{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}"{{- with $coreKid.Title}} title="{{- $coreKid.Title -}}"{{- end -}}><span class="sup">{{- substr $coreKid.File.Dir 0 -1 -}}⁄</span>{{- $coreKid.Title -}}</a>
|
||||
{{ $scratchCKid := $s.Get (printf "/%s" $coreKid.File) }}
|
||||
{{ range $mantleKid := $scratchCKid.has_children }}
|
||||
<div class="sitemap"><a href="{{- $mantleKid.RelPermalink -}}{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}"{{- with $mantleKid.Title}} title="{{- $mantleKid.Title -}}"{{- end -}}><span class="sup">{{- substr $mantleKid.File.Dir 0 -1 -}}⁄</span>{{- $mantleKid.Title -}}</a></div>
|
||||
{{ end }}
|
||||
<hr />
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ else if not (in (slice "core" "mantle" "crust") $scratch.depth)}}
|
||||
{{ $noTriad = $noTriad | append $p }}
|
||||
{{ else }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ range $noTriad }}
|
||||
<div class="sitemap"><a href="{{- .RelPermalink -}}{{- if eq hugo.Environment "offline" -}}index.html{{- end -}}"{{- with .Title }} title="{{- . -}}"{{- end -}}><span class="sup">{{- substr .File.Dir 0 -1 -}}⁄</span>{{- .Title -}}</a></div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
Loading…
Add table
Reference in a new issue