update reply by email generation

This commit is contained in:
John Bowdre 2024-05-01 10:14:25 -05:00
parent e9c5952076
commit bf7823c56f
2 changed files with 9 additions and 3 deletions

View file

@ -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

View file

@ -57,8 +57,10 @@
{{- else if eq .Params.emailReplies false }}
{{- $emailReplies = false }}
{{- end }}
{{- if and (eq .Site.Params.comments true) (ne $emailReplies false) }}
<span class="post_email_reply"><a href="mailto:blogreply-{{ .Title | truncate 40 | urlize}}@runtimeterror.dev?Subject=Re: {{ .Title }}">📧 Reply by email</a></span>
{{- if and (eq .Site.Params.comments true) (eq $emailReplies true) }}
{{- $path := path.BaseName . | strings.TrimSuffix ")" }}
{{- $address := printf "blogreply.%s@%s" $path "runtimeterror.dev" }}
<span class="post_email_reply"><a href="mailto:{{ $address }}?Subject=Re: {{ .Title }}">📧 Reply by email</a></span>
{{- end }}
<br><details class="comments_widget"><summary>Comments</summary>
{{- partial "comments" . }}