hugo-theme-relearn/layouts/shortcodes/relref.html
2017-08-20 23:43:44 +02:00

12 lines
No EOL
309 B
HTML

{{- if in (.Get 0) "/_index.md" -}}
{{- $path := (trim (.Get 0) "_index.md") -}}
{{- with .Site.GetPage "section" (trim $path "/") -}}
{{- .URL -}}
{{- end -}}
{{- else -}}
{{- with .Site.GetPage "section" (.Get 0) }}
{{- .URL -}}
{{- else -}}
{{- .Get 0 | relref .Page -}}
{{- end -}}
{{- end -}}