Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Dec 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions assets/css/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -273,3 +273,14 @@ a.fn-item {
.site-footer a:hover {
color: var(--sticky-menu-text-color);
}

/* Bottom Icons */
.icons {
ol {
padding-left: 0;
}

li {
display: inline-block;
}
}
8 changes: 8 additions & 0 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
invertSectionColors = false

[params.footer]
# Show contact icons for email/phone (if specified) in the footer of the page
showContactIcons = false

[params.meta]
keywords = "some, keywords, for, seo, you, know, google, duckduckgo, and, such"

[params.contact]
email = "[email protected]"
phone = "+49 1111 555555"
4 changes: 2 additions & 2 deletions exampleSite/content/homepage/contact.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ weight: 4
header_menu: true
---

{{<icon class="fa fa-envelope">}}&nbsp;[[email protected]](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!
5 changes: 5 additions & 0 deletions i18n/de.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[email]
other = "Email"

[phone]
other = "Telefon"
5 changes: 5 additions & 0 deletions i18n/en.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[email]
other = "Email"

[phone]
other = "Phone"
11 changes: 11 additions & 0 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
<footer class="site-footer">
<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 }}
<section class="copyright">{{ . | safeHTML }}</section>
{{ end }}
Expand Down
1 change: 1 addition & 0 deletions layouts/shortcodes/email.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ .Site.Params.contact.email }}
1 change: 1 addition & 0 deletions layouts/shortcodes/phone.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ .Site.Params.contact.phone }}