fix for reply email address generation

This commit is contained in:
John Bowdre 2024-05-01 10:40:19 -05:00
parent 5e4426a035
commit 1cc1d0317f
2 changed files with 4 additions and 2 deletions

View file

@ -46,7 +46,8 @@
--- ---
{{ $subject := printf "Re: %s" .Title -}} {{ $subject := printf "Re: %s" .Title -}}
{{ $subject := urlquery $subject | replaceRE `\+` "%20" }} {{ $subject := urlquery $subject | replaceRE `\+` "%20" }}
{{ $path := path.BaseName . | strings.TrimSuffix ")" -}} {{ $path := .Page.RelPermalink | path.Dir -}}
{{ $path := strings.Trim $path "/" -}}
{{ $address := printf "blogreply.%s@%s" $path "runtimeterror.dev" -}} {{ $address := printf "blogreply.%s@%s" $path "runtimeterror.dev" -}}
=> mailto:{{ $address }}?subject={{ $subject }} 📧 Reply by email => mailto:{{ $address }}?subject={{ $subject }} 📧 Reply by email

View file

@ -58,7 +58,8 @@
{{- $emailReplies = false }} {{- $emailReplies = false }}
{{- end }} {{- end }}
{{- if and (eq .Site.Params.comments true) (eq $emailReplies true) }} {{- if and (eq .Site.Params.comments true) (eq $emailReplies true) }}
{{- $path := path.BaseName . | strings.TrimSuffix ")" }} {{- $path := .Page.RelPermalink | path.Dir }}
{{- $path := strings.Trim $path "/" }}
{{- $address := printf "blogreply.%s@%s" $path "runtimeterror.dev" }} {{- $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> <span class="post_email_reply"><a href="mailto:{{ $address }}?Subject=Re: {{ .Title }}">📧 Reply by email</a></span>
{{- end }} {{- end }}