mirror of
https://github.com/imfing/hextra.git
synced 2025-05-14 17:06:26 -04:00

fix: navbar icon should use home relative link fix: copy code for raw <code> element fix: missing breadcrumb hover style fix: tabs typo preventing loading the script
26 lines
537 B
HTML
26 lines
537 B
HTML
{{/* Get relative link of a page for given language */}}
|
|
{{/* If not found, return the homepage of the language page */}}
|
|
|
|
{{ $page := .context }}
|
|
{{ $lang := .lang }}
|
|
|
|
{{ $link := false }}
|
|
|
|
{{ range $page.AllTranslations }}
|
|
{{ if eq .Language.Lang $lang }}
|
|
{{ $link = .RelPermalink }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ if not $link }}
|
|
{{ range where $page.Sites ".Language.Lang" $lang }}
|
|
{{ $link = .Home.RelPermalink }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ if not $link }}
|
|
{{ $link = site.Home.RelPermalink }}
|
|
{{ end }}
|
|
|
|
{{ return $link }}
|