diff --git a/layouts/_default/single.gmi b/layouts/_default/single.gmi index ecafc5b..345baae 100644 --- a/layouts/_default/single.gmi +++ b/layouts/_default/single.gmi @@ -46,7 +46,8 @@ --- {{ $subject := printf "Re: %s" .Title -}} {{ $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" -}} => mailto:{{ $address }}?subject={{ $subject }} 📧 Reply by email diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 53e54a8..53081fd 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -58,7 +58,8 @@ {{- $emailReplies = false }} {{- end }} {{- 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" }} 📧 Reply by email {{- end }}