{{- /* sigdl — Download & Verify block for each post. Usage: {{< sigdl >}} Normalizes index.md/_index.md so links become /sources/.md */ -}} {{- /* Compute a normalized relative path for the source */ -}} {{- $rel := replace .Page.File.Path "content/" "" -}} {{- $rel = replace $rel "/index.md" ".md" -}} {{- $rel = replace $rel "/_index.md" ".md" -}} {{- $download := printf "/sources/%s" $rel -}} {{- $asc := printf "%s.asc" $download -}} {{- $staticAscPath := printf "static%s.asc" $download -}} {{- $sig := "" -}} {{- if (fileExists $staticAscPath) -}} {{- $sig = (readFile $staticAscPath) | htmlEscape -}} {{- end -}} {{/* Robust onion detection: 1) prefer --environment onion 2) else parse .Site.Params.isOnion (string-safe) 3) else check baseURL contains ".onion" */}} {{- $isOnion := eq hugo.Environment "onion" -}} {{- if not $isOnion -}} {{- with .Site.Params.isOnion -}} {{- $v := (printf "%v" . | lower) -}} {{- if or (eq $v "true") (eq $v "1") (eq $v "yes") (eq $v "on") -}} {{- $isOnion = true -}} {{- end -}} {{- end -}} {{- end -}} {{- if and (not $isOnion) (in (lower (site.BaseURL)) ".onion") -}} {{- $isOnion = true -}} {{- end -}}

Downloads: Markdown · Signature (.asc)

{{- if $sig -}}
View OpenPGP signature
{{ $sig }}
{{- end -}}

Verify locally:

{{- if $isOnion -}}
torsocks curl -fSLO {{ $download | absURL }}
torsocks curl -fSLO {{ $asc      | absURL }}
{{- else -}}
curl -fSLO {{ $download | absURL }}
curl -fSLO {{ $asc      | absURL }}
{{- end }}
gpg --verify {{ path.Base $asc }} {{ path.Base $download }}