mirror of
https://github.com/rottenwheel/revuoxmrtheme.git
synced 2024-11-09 20:20:06 +00:00
fix: get safeURL to work
This commit is contained in:
parent
8726659263
commit
1131349487
3 changed files with 10 additions and 3 deletions
|
@ -1,6 +1,8 @@
|
||||||
{{ with .Site.Params.bottom_nav_icons }}
|
{{ with .Site.Params.bottom_nav_icons }}
|
||||||
{{ range . }}
|
{{ range . }}
|
||||||
<a class="icon" href="{{ .link | safeURL }}" target="_blank">
|
<!-- safeURL only works when the link is stored in a variable -->
|
||||||
|
{{ $link := .link }}
|
||||||
|
<a class="icon" href="{{ $link | safeURL }}" target="_blank">
|
||||||
<img src="/img/{{ .icon }}" alt="{{ .icon_alt }}" title="{{ .title }}" />
|
<img src="/img/{{ .icon }}" alt="{{ .icon_alt }}" title="{{ .title }}" />
|
||||||
</a>
|
</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
{{ with .Site.Params.nav_links }}
|
{{ with .Site.Params.nav_links }}
|
||||||
{{ range . }}
|
{{ range . }}
|
||||||
<a href="{{ .link | safeURL }}" title="{{ .title }}">{{ .title }}</a>
|
<!-- safeURL only works when the link is stored in a variable -->
|
||||||
|
{{ $link := .link }}
|
||||||
|
<a href="{{ $link | safeURL }}" title="{{ .title }}">{{ .title }}</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
|
@ -1,7 +1,10 @@
|
||||||
{{ with .Site.Params.right_icons }}
|
{{ with .Site.Params.right_icons }}
|
||||||
{{ range . }}
|
{{ range . }}
|
||||||
{{ $target := cond .external "_blank" "_self" }}
|
{{ $target := cond .external "_blank" "_self" }}
|
||||||
<a class="icon" href="{{ .link | safeURL }}" target="{{ $target }}">
|
|
||||||
|
<!-- safeURL only works when the link is stored in a variable -->
|
||||||
|
{{ $link := .link }}
|
||||||
|
<a class="icon" href="{{ $link | safeURL }}" target="{{ $target }}">
|
||||||
<img src="/img/{{ .icon }}" alt="{{ .icon_alt }}" title="{{ .title }}" />
|
<img src="/img/{{ .icon }}" alt="{{ .icon_alt }}" title="{{ .title }}" />
|
||||||
</a>
|
</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Reference in a new issue