From f2f3177d789786532d8faae262c24f499ed21ea9 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Mon, 3 Dec 2018 17:47:34 +0000 Subject: [PATCH] feat(widget): add appointment booking link to contact widget Close #828 BREAKING CHANGE Replace any `\n` with `\\` in the `address` field. --- exampleSite/config.toml | 10 +++++++++- i18n/en.yaml | 3 +++ layouts/partials/widgets/contact.html | 11 +++++++++-- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index ed23a662..d1496496 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -46,6 +46,7 @@ enableGitInfo = false hrefTargetBlank = true # `true` opens external links in a new tab. fractions = true # `false` disables smart fractions (e.g. 5/12 formatted as a fraction). smartypants = true # `false` disables all smart punctuation substitutions (e.g. smart quotes, dashes, fractions). + extensions = ["backslashLineBreak"] [params] # AUTHOR SETUP @@ -64,12 +65,19 @@ enableGitInfo = false # Details for the Contact Widget email = "test@example.org" address = "Building 1 Room 1, Stanford University, California, 90210, USA" - office_hours = "Monday 10:00 to 13:00 or email for appointment" + office_hours = """ + Monday 10:00 to 13:00\\ + Wednesday 09:00 to 10:00\\ + Otherwise email to book an appointment + """ phone = "888 888 88 88" skype = "echo123" telegram = "" keybase = "" # Your keybase.io username. + # Enter an optional link for booking appointments (e.g. calendly.com). + appointment_url = "" + # Discussion link (e.g. link to a forum, mailing list, or chat). # Uncomment line below to use. # discussion = { name = "Discuss", url = "https://discourse.gohugo.io" } diff --git a/i18n/en.yaml b/i18n/en.yaml index 43555a44..1ec92e32 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -112,6 +112,9 @@ - id: contact_send translation: Send +- id: book_appointment + translation: Book an appointment + # Publication/Talk details - id: abstract diff --git a/layouts/partials/widgets/contact.html b/layouts/partials/widgets/contact.html index a0e03fd2..ea334d0a 100644 --- a/layouts/partials/widgets/contact.html +++ b/layouts/partials/widgets/contact.html @@ -101,14 +101,21 @@ {{ with $.Site.Params.address }}
  • - {{ replace . "\n" "
    " | safeHTML }}
    + {{ . | markdownify | emojify }}
  • {{ end }} {{ with $.Site.Params.office_hours }}
  • - {{ . }} + {{ . | markdownify | emojify }} +
  • + {{ end }} + + {{ with $.Site.Params.appointment_url }} +
  • + + {{ i18n "book_appointment" | default "Book an appointment" }}
  • {{ end }}