Define contact information in params, add to footer of the page (#166)

contact icons in footer, opt-in via parameter
This commit is contained in:
Daniel Holbach 2023-12-23 19:08:45 +01:00 committed by GitHub
parent 4f5883c14d
commit f1d65eeccb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 44 additions and 2 deletions

View file

@ -273,3 +273,14 @@ a.fn-item {
.site-footer a:hover { .site-footer a:hover {
color: var(--sticky-menu-text-color); color: var(--sticky-menu-text-color);
} }
/* Bottom Icons */
.icons {
ol {
padding-left: 0;
}
li {
display: inline-block;
}
}

View file

@ -51,5 +51,13 @@ title = "Jane Doe - Nutrition Coach & Chef Consultant"
# The sections of the home page alternate styling. Mark invert as true to swap the styling of the sections # The sections of the home page alternate styling. Mark invert as true to swap the styling of the sections
invertSectionColors = false invertSectionColors = false
[params.footer]
# Show contact icons for email/phone (if specified) in the footer of the page
showContactIcons = false
[params.meta] [params.meta]
keywords = "some, keywords, for, seo, you, know, google, duckduckgo, and, such" keywords = "some, keywords, for, seo, you, know, google, duckduckgo, and, such"
[params.contact]
email = "mail@janedoe.com"
phone = "+49 1111 555555"

View file

@ -4,8 +4,8 @@ weight: 4
header_menu: true header_menu: true
--- ---
{{<icon class="fa fa-envelope">}}&nbsp;[mail@janedoe.com](mailto:your-email@your-domain.com) {{<icon class="fa fa-envelope">}}&nbsp;[{{<email>}}](mailto:{{<email>}})
{{<icon class="fa fa-phone">}}&nbsp;[+49 1111 555555](tel:+491111555555) {{<icon class="fa fa-phone">}}&nbsp;[{{<phone>}}](tel:{{<phone>}})
Let us get in touch! Let us get in touch!

5
i18n/de.toml Normal file
View file

@ -0,0 +1,5 @@
[email]
other = "Email"
[phone]
other = "Telefon"

5
i18n/en.toml Normal file
View file

@ -0,0 +1,5 @@
[email]
other = "Email"
[phone]
other = "Phone"

View file

@ -1,5 +1,16 @@
<footer class="site-footer"> <footer class="site-footer">
<div class="inner"> <div class="inner">
{{ if ne .Site.Params.footer.showContactIcons false }}
{{ with .Site.Params.contact }}
<section class="icons">
<ol>
<li><a href="mailto:{{ .email }}" aria-label='{{ i18n "email" }}'><i class="fa fa-envelope"></i></a></li>
<li><a href="tel:{{ .phone }}" aria-label='{{ i18n "phone" }}'><i class="fa fa-phone"></i></a></li>
</ol>
</section>
{{ end }}
{{ end }}
{{ with .Site.Params.copyright }} {{ with .Site.Params.copyright }}
<section class="copyright">{{ . | safeHTML }}</section> <section class="copyright">{{ . | safeHTML }}</section>
{{ end }} {{ end }}

View file

@ -0,0 +1 @@
{{ .Site.Params.contact.email }}

View file

@ -0,0 +1 @@
{{ .Site.Params.contact.phone }}