fix: navbar url for multi-lang site (#193)

* fix: image URL in feature card

* fix: use relLangURL of pageRef for navbar entries
This commit is contained in:
Xin
2023-11-10 12:45:44 -05:00
committed by GitHub
parent 678f0b86ee
commit 23c84e124c
2 changed files with 14 additions and 3 deletions

View File

@ -10,6 +10,10 @@
{{- $external := hasPrefix $link "http" -}}
{{- $href := cond (strings.HasPrefix $link "/") ($link | relURL) $link -}}
{{- if hasPrefix $image "/" -}}
{{- $image = relURL (strings.TrimPrefix "/" $image) -}}
{{- end -}}
<a
{{ with $link }}href="{{ $href }}" {{ with $external }} target="_blank" rel="noreferrer"{{ end }}{{ end }}
{{ with $style }}style="{{ . | safeCSS }}"{{ end }}