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