mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-27 17:53:07 +00:00
14 lines
No EOL
440 B
HTML
14 lines
No EOL
440 B
HTML
{{- if in (.Get 0) "/_index.md" -}}
|
|
{{- $paths := (split (.Get 0) "_index.md") -}}
|
|
{{- $pagepath := index $paths 0 -}}
|
|
{{- $anchor := index $paths 1 -}}
|
|
{{- with .Site.GetPage "section" (trim $pagepath "/") -}}
|
|
{{- ( printf "%s%s" $pagepath $anchor ) | relLangURL -}}
|
|
{{- end -}}
|
|
{{- else -}}
|
|
{{- with .Site.GetPage "section" (.Get 0) }}
|
|
{{- .RelPermalink -}}
|
|
{{- else -}}
|
|
{{- .Get 0 | relref .Page -}}
|
|
{{- end -}}
|
|
{{- end -}} |