aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/shortcodes/abbr.html
diff options
context:
space:
mode:
Diffstat (limited to 'themes/default/layouts/shortcodes/abbr.html')
-rw-r--r--themes/default/layouts/shortcodes/abbr.html7
1 files changed, 4 insertions, 3 deletions
diff --git a/themes/default/layouts/shortcodes/abbr.html b/themes/default/layouts/shortcodes/abbr.html
index 0edff43..61a2e32 100644
--- a/themes/default/layouts/shortcodes/abbr.html
+++ b/themes/default/layouts/shortcodes/abbr.html
@@ -1,7 +1,8 @@
{{- $abbr := default "TL;DR:" (.Get "abbr" | default (.Get 0)) -}}
{{- $title := default "Too long, didn't read" (.Get "title" | default (.Get 1)) -}}
+{{- $hash := print (truncate 4 "" (sha256 .Page.RelPermalink)) (truncate 4 "" (sha256 $abbr)) .Ordinal -}}
-{{- $id := delimit (shuffle (seq 0 20)) "" -}}
-<input hidden type="checkbox" id="abbr-{{ $id }}" />
-<abbr title="{{ $title }}"><label for="abbr-{{ $id }}">{{ $abbr | markdownify }}</label></abbr>
+<input hidden="" type="checkbox" id="abbr-{{ $hash }}" />
+{{- /* This comment removes trailing newlines and white spaces. */ -}}
+<abbr title="{{ $title }}"><label for="abbr-{{ $hash }}">{{ $abbr | markdownify }}</label></abbr>
{{- /* This comment removes trailing newlines and white spaces. */ -}}