relref.html 431 B

1234567891011121314
  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. {{- .URL -}}
  11. {{- else -}}
  12. {{- .Get 0 | relref .Page -}}
  13. {{- end -}}
  14. {{- end -}}