From bf7823c56f00994ca90f7ad8bec00e3f1c3362cb Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Wed, 1 May 2024 10:14:25 -0500 Subject: [PATCH] update reply by email generation --- layouts/_default/single.gmi | 6 +++++- layouts/_default/single.html | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/layouts/_default/single.gmi b/layouts/_default/single.gmi index d48ba07..ecafc5b 100644 --- a/layouts/_default/single.gmi +++ b/layouts/_default/single.gmi @@ -45,7 +45,11 @@ --- {{ $subject := printf "Re: %s" .Title -}} -=> mailto:blog@runtimeterror.dev?subject={{ urlquery $subject | replaceRE `\+` "%20" }} 📧 Reply via email +{{ $subject := urlquery $subject | replaceRE `\+` "%20" }} +{{ $path := path.BaseName . | strings.TrimSuffix ")" -}} +{{ $address := printf "blogreply.%s@%s" $path "runtimeterror.dev" -}} + +=> mailto:{{ $address }}?subject={{ $subject }} 📧 Reply by email {{ $related := first 3 (where (where .Site.RegularPages.ByDate.Reverse ".Params.tags" "intersect" .Params.tags) "Permalink" "!=" .Permalink) }} {{ if $related }} ## Related articles diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 57a627c..53e54a8 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -57,8 +57,10 @@ {{- else if eq .Params.emailReplies false }} {{- $emailReplies = false }} {{- end }} - {{- if and (eq .Site.Params.comments true) (ne $emailReplies false) }} - 📧 Reply by email + {{- if and (eq .Site.Params.comments true) (eq $emailReplies true) }} + {{- $path := path.BaseName . | strings.TrimSuffix ")" }} + {{- $address := printf "blogreply.%s@%s" $path "runtimeterror.dev" }} + 📧 Reply by email {{- end }}
Comments {{- partial "comments" . }}