Merge pull request #2 from recanman/main

fix: add safeURL to navigation links
This commit is contained in:
rottenwheel 2024-07-03 14:20:05 -05:00 committed by GitHub
commit 7c6001c6ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View file

@ -1,6 +1,6 @@
{{ with .Site.Params.bottom_nav_icons }}
{{ range . }}
<a class="icon" href="{{ .link }}" target="_blank">
<a class="icon" href="{{ .link | safeURL }}" target="_blank">
<img src="/img/{{ .icon }}" alt="{{ .icon_alt }}" title="{{ .title }}" />
</a>
{{ end }}

View file

@ -1,5 +1,5 @@
{{ with .Site.Params.nav_links }}
{{ range . }}
<a href="{{ .link }}" title="{{ .title }}">{{ .title }}</a>
<a href="{{ .link | safeURL }}" title="{{ .title }}">{{ .title }}</a>
{{ end }}
{{ end }}

View file

@ -1,7 +1,7 @@
{{ with .Site.Params.right_icons }}
{{ range . }}
{{ $target := cond .external "_blank" "_self" }}
<a class="icon" href="{{ .link }}" target="{{ $target }}">
<a class="icon" href="{{ .link | safeURL }}" target="{{ $target }}">
<img src="/img/{{ .icon }}" alt="{{ .icon_alt }}" title="{{ .title }}" />
</a>
{{ end }}