From 1dbb750bc0a576755ecc215636ea0ec47b30542f Mon Sep 17 00:00:00 2001 From: Filippo Fontana Date: Sun, 17 Mar 2024 12:19:31 +0100 Subject: [PATCH] Fix #173: `tel:` link is now handled correctly by Hugo The `safeURL` function is required to insert URLs that are different than `http:`, `https:` and `mailto:` (e.g. `tel:`) through the Hugo templating system. Additionally, an example about how to add new contacts is added in the `config.toml` of `exampleSite`. Signed-off-by: Filippo Fontana --- exampleSite/config.toml | 11 +++++++++-- layouts/partials/footer.html | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 165978b..6ed5f41 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -64,11 +64,18 @@ title = "Jane Doe - Nutrition Coach & Chef Consultant" [[params.contacts]] label = "phone" value = "+49 1111 555555" - url = "tel: +49 1111 555555" + url = "tel:+49 1111 555555" icon = "fa fa-phone" [[params.contacts]] label = "email" value = "mail@janedoe.com" - url = "mailto: mail@janedoe.com" + url = "mailto:mail@janedoe.com" icon = "fa fa-envelope" + + # Add additional contacts here! + # [[params.contacts]] + # label = "" + # value = "" + # url = "" + # icon = "" diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index c8ca859..7057c70 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -20,7 +20,7 @@ {{ if ne .Site.Params.footer.showContactIcons false }}
{{ range .Site.Params.contacts }} - + {{ end }}
{{ end }}