From 5088638936b577652518da20e23fd627f5326dc4 Mon Sep 17 00:00:00 2001 From: Mordecai K <39312305+insidemordecai@users.noreply.github.com> Date: Wed, 31 Jul 2024 16:42:39 +0300 Subject: [PATCH 1/3] feat: add reply via email functionality --- config/_default/languages.en.toml | 1 + config/_default/params.toml | 2 ++ layouts/_default/single.html | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/config/_default/languages.en.toml b/config/_default/languages.en.toml index e334ec9a..1c293d19 100644 --- a/config/_default/languages.en.toml +++ b/config/_default/languages.en.toml @@ -15,6 +15,7 @@ title = "Blowfish" # [author] # name = "Your name here" +# email = "youremail@example.com" # image = "img/blowfish_logo.png" # headline = "I'm only human" # bio = "A little bit about you" diff --git a/config/_default/params.toml b/config/_default/params.toml index fc4edcb2..8963d98d 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -12,6 +12,8 @@ autoSwitchAppearance = true enableSearch = true enableCodeCopy = false +replyByEmail = false + # mainSections = ["section1", "section2"] # robots = "" diff --git a/layouts/_default/single.html b/layouts/_default/single.html index ad07f7d3..b208e92d 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -81,6 +81,11 @@
{{ .Content }} + {{ $defaultReplyByEmail := .Site.Params.replyByEmail }} + {{ $replyByEmail := default $defaultReplyByEmail .Params.replyByEmail }} + {{ if $replyByEmail }} + Reply by Email + {{ end }}
{{ if (.Params.showAuthorBottom | default ( .Site.Params.article.showAuthorBottom | default false)) }} From 43233a4e549d77b4bcaf76846772bc2795668558 Mon Sep 17 00:00:00 2001 From: Mordecai K <39312305+insidemordecai@users.noreply.github.com> Date: Wed, 31 Jul 2024 17:04:38 +0300 Subject: [PATCH 2/3] docs: reply-by-email --- exampleSite/content/docs/configuration/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exampleSite/content/docs/configuration/index.md b/exampleSite/content/docs/configuration/index.md index 7b3ce190..03dfa55f 100644 --- a/exampleSite/content/docs/configuration/index.md +++ b/exampleSite/content/docs/configuration/index.md @@ -139,6 +139,7 @@ The default file can be used as a template to create additional languages, or re | Name | Default | Description | | ----------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `author.name` | _Not set_ | The author's name. This will be displayed in article footers, and on the homepage when the profile layout is used. | +| `author.email` | _Not set_ | The author's email. This will be used if the reply-via-email functionality is enabled. | | `author.image` | _Not set_ | Path to the image file of the author. The image should be a 1:1 aspect ratio. The image can be placed in the site's `assets/` folder or can be external url. | | `author.headline` | _Not set_ | A Markdown string containing the author's headline. It will be displayed on the profile homepage under the author's name. | | `author.bio` | _Not set_ | A Markdown string containing the author's bio. It will be displayed in article footers. | @@ -170,6 +171,7 @@ Many of the article defaults here can be overridden on a per article basis by sp | `autoSwitchAppearance` | `true` | Whether the theme appearance automatically switches based upon the visitor's operating system preference. Set to `false` to force the site to always use the `defaultAppearance`. | | `enableSearch` | `false` | Whether site search is enabled. Set to `true` to enable search functionality. Note that the search feature depends on the `outputs.home` setting in the [site configuration](#site-configuration) being set correctly. | | `enableCodeCopy` | `false` | Whether copy-to-clipboard buttons are enabled for `` blocks. The `highlight.noClasses` parameter must be set to `false` for code copy to function correctly. Read more about [other configuration files](#other-configuration-files) below. | +| `replyByEmail` | `false` | Whether the reply-by-email link is enabled after post. The `author.email` parameter in `config/_default/languages.en.toml` must be set. | | `mainSections` | _Not set_ | The sections that should be displayed in the recent articles list. If not provided the section with the greatest number of articles is used. | | `showViews` | _Not set_ | Whether or not articles and list views are displayed. This requires firebase integrations to be enabled, look below. | | `showLikes` | _Not set_ | Whether or not articles and list likes are displayed. This requires firebase integrations to be enabled, look below. | From 47b99754e13b59df0e9d8fa41277b0e3189b812e Mon Sep 17 00:00:00 2001 From: Mordecai K <39312305+insidemordecai@users.noreply.github.com> Date: Mon, 5 Aug 2024 11:30:56 +0300 Subject: [PATCH 3/3] style(reply-by-email): separation from content Add more separation from the content by adding a top margin Add button-like styling to differentiate the link --- layouts/_default/single.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/layouts/_default/single.html b/layouts/_default/single.html index b208e92d..0331f6a6 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -84,7 +84,13 @@ {{ $defaultReplyByEmail := .Site.Params.replyByEmail }} {{ $replyByEmail := default $defaultReplyByEmail .Params.replyByEmail }} {{ if $replyByEmail }} - Reply by Email + + + Reply by Email + + {{ end }}