github.com/mweagle/Sparta@v1.15.0/docs_source/themes/hugo-theme-learn/layouts/shortcodes/relref.html (about) 1 {{- if in (.Get 0) "/_index.md" -}} 2 {{- $paths := (split (.Get 0) "_index.md") -}} 3 {{- $pagepath := index $paths 0 -}} 4 {{- $anchor := index $paths 1 -}} 5 {{- with .Site.GetPage "section" (trim $pagepath "/") -}} 6 {{- ( printf "%s%s" $pagepath $anchor ) | relLangURL -}} 7 {{- end -}} 8 {{- else -}} 9 {{- with .Site.GetPage "section" (.Get 0) }} 10 {{- .RelPermalink -}} 11 {{- else -}} 12 {{- .Get 0 | relref .Page -}} 13 {{- end -}} 14 {{- end -}}