From 77893ccf469ace26f2fb32583777f6af3a281e87 Mon Sep 17 00:00:00 2001 From: Caio Lente <7017340+clente@users.noreply.github.com> Date: Tue, 17 Oct 2023 01:10:22 -0300 Subject: [PATCH] Move 'reply by email' button to the bottom of every post --- README.md | 5 ++++- exampleSite/config.toml | 2 +- i18n/en.toml | 3 +++ i18n/pt.toml | 3 +++ layouts/_default/single.html | 7 +++++++ layouts/partials/nav.html | 3 --- 6 files changed, 18 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0427ffc..73a7f11 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,9 @@ already implemented: can be focused by people who need a keyboard to navigate the web (see [PR #5](https://github.com/clente/hugo-bearcub/pull/5) by [@2kool4idkwhat](https://github.com/2kool4idkwhat) for more information). +- Reply by email: if you supply an email address, the theme creates a "Reply to + this post by email" button at the end of every post (see Kev Quirk's [original + implementation](https://kevquirk.com/adding-the-post-title-to-my-reply-by-email-button)). - Single-use CSS (EXPERIMENTAL): you can add some styles to a single page by writing the CSS you need in `assets/{custom_css}.css` and then including `style: "{custom_css}.css"` in the [front @@ -208,7 +211,7 @@ enableRobotsTXT = true # Social media. Delete any item you aren't using to make sure it won't show up # in your website's metadata. [social] - email = "me@example.com" # Added to the navbar so readers can reply to posts + email = "me@example.com" # Added to the footer so readers can reply to posts twitter = "example" # Twitter handle (without '@') facebook_admin = "0000000000" # Facebook Page Admin ID ``` diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 3b68b53..b6c67c8 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -79,6 +79,6 @@ enableRobotsTXT = true # Social media. Delete any item you aren't using to make sure it won't show up # in your website's metadata. [social] - email = "me@example.com" # Added to the navbar so readers can reply to posts + email = "me@example.com" # Added to the footer so readers can reply to posts twitter = "example" # Twitter handle (without '@') facebook_admin = "0000000000" # Facebook Page Admin ID diff --git a/i18n/en.toml b/i18n/en.toml index b7738dd..15a8569 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -7,5 +7,8 @@ [email-subject] other = "Reply to " +[email-reply] + other = "Reply to this post by email" + [skip-link] other = "Skip to main content" \ No newline at end of file diff --git a/i18n/pt.toml b/i18n/pt.toml index 33fc65f..ad228ab 100644 --- a/i18n/pt.toml +++ b/i18n/pt.toml @@ -7,5 +7,8 @@ [email-subject] other = "Resposta a " +[email-reply] + other = "Responda a este post por email" + [skip-link] other = "Pular para conteúdo principal" \ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html index cd6b095..30de616 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -17,4 +17,11 @@ #{{ .LinkTitle }}   {{ end }}

+{{ with .Site.Social.email }} +

+ + {{ i18n "email-reply" }} ↪ + +

+{{ end }} {{ end }} diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html index 2cc03a2..e78affe 100644 --- a/layouts/partials/nav.html +++ b/layouts/partials/nav.html @@ -1,9 +1,6 @@ {{ range .Site.Menus.main.ByWeight }} {{ .Name }} {{ end }} -{{ with .Site.Social.email }} -Email -{{ end }} RSS