Permalink
Browse files

feat(widget): add appointment booking link to contact widget

Close #828

BREAKING CHANGE

Replace any `\n` with `\\` in the `address` field.
  • Loading branch information...
gcushen committed Dec 3, 2018
1 parent 2bfa048 commit f2f3177d789786532d8faae262c24f499ed21ea9
Showing with 21 additions and 3 deletions.
  1. +9 −1 exampleSite/config.toml
  2. +3 −0 i18n/en.yaml
  3. +9 −2 layouts/partials/widgets/contact.html
@@ -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" }
@@ -112,6 +112,9 @@
- id: contact_send
translation: Send
- id: book_appointment
translation: Book an appointment
# Publication/Talk details
- id: abstract
@@ -101,14 +101,21 @@ <h1>{{ with $page.Title }}{{ . | markdownify }}{{ end }}</h1>
{{ with $.Site.Params.address }}
<li>
<i class="fa-li fas fa-map-marker fa-2x" aria-hidden="true"></i>
<span id="person-address" itemprop="address">{{ replace . "\n" "<br>" | safeHTML }}</span>
<span id="person-address" itemprop="address">{{ . | markdownify | emojify }}</span>
</li>
{{ end }}
{{ with $.Site.Params.office_hours }}
<li>
<i class="fa-li fas fa-clock fa-2x" aria-hidden="true"></i>
<span>{{ . }}</span>
<span>{{ . | markdownify | emojify }}</span>
</li>
{{ end }}
{{ with $.Site.Params.appointment_url }}
<li>
<i class="fa-li fas fa-calendar-check fa-2x" aria-hidden="true"></i>
<a href="{{ . }}" target="_blank" rel="noopener">{{ i18n "book_appointment" | default "Book an appointment" }}</a>
</li>
{{ end }}

0 comments on commit f2f3177

Please sign in to comment.