mirror of
https://github.com/McShelby/hugo-theme-relearn
synced 2025-05-06 09:26:33 +08:00
12 lines
309 B
HTML
12 lines
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 -}} |