Skip to content

Commit

Permalink
Safe topbar links. (#324)
Browse files Browse the repository at this point in the history
Co-authored-by: Guillermo Guerrero Ibarra <[email protected]>
  • Loading branch information
ryanfox1985 and guillermogue authored Sep 5, 2021
1 parent 152f978 commit a660129
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -355,24 +355,30 @@ paginate = 10

[[menu.topbar]]
weight = 1
name = "Phone"
url = "tel:+12 34 567 89 01"
pre = "<i class='fas fa-2x fa-phone'></i>"

[[menu.topbar]]
weight = 2
name = "GitHub"
url = "https://github.com/devcows/hugo-universal-theme"
pre = "<i class='fab fa-2x fa-github'></i>"

[[menu.topbar]]
weight = 2
weight = 3
name = "Facebook"
url = "http://facebook.com"
pre = "<i class='fab fa-2x fa-facebook'></i>"

[[menu.topbar]]
weight = 3
weight = 4
name = "Twitter"
url = "http://twitter.com"
pre = "<i class='fab fa-2x fa-twitter'></i>"

[[menu.topbar]]
weight = 4
weight = 5
name = "Email"
url = "mailto:[email protected]"
pre = "<i class='fas fa-2x fa-envelope'></i>"
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/top.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="col-xs-7">
<div class="social">
{{ range .Site.Menus.topbar.ByWeight }}
<a href="{{ .URL }}" target="_blank" style="opacity: 1;">{{ .Pre }}</a>
<a href="{{ .URL | safeURL }}" target="_blank" style="opacity: 1;">{{ .Pre }}</a>
{{ end }}
</div>
</div>
Expand Down

0 comments on commit a660129

Please sign in to comment.