diff options
author | Guillermo Guerrero Ibarra <wolf.fox1985@gmail.com> | 2021-09-06 00:40:02 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-06 00:40:02 +0300 |
commit | a66012965897579f404593ef4a8808a5e5620925 (patch) | |
tree | c56c230b33b1c60b88dc42a17e17db195d2ef010 | |
parent | 152f9787d9078c5aed3ecb8c9b3f455934ff9657 (diff) |
Safe topbar links. (#324)1.2.4
Co-authored-by: Guillermo Guerrero Ibarra <guillermo.guerrero@deliveroo.co.uk>
-rw-r--r-- | exampleSite/config.toml | 12 | ||||
-rw-r--r-- | layouts/partials/top.html | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 1dd0b4a..3588292 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -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:hello@universal.com" pre = "<i class='fas fa-2x fa-envelope'></i>" diff --git a/layouts/partials/top.html b/layouts/partials/top.html index fd4b7a9..25351ad 100644 --- a/layouts/partials/top.html +++ b/layouts/partials/top.html @@ -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> |