diff options
author | tdro <tdro@noreply.example.com> | 2022-08-16 02:01:07 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2022-08-16 02:01:07 -0400 |
commit | fb0eafd272a6cee9b8f9e380cd028f4edde18298 (patch) | |
tree | bcfea7c1cd10b4256cc5b2b062d68cbb0005db63 /themes/default/layouts/partials/meta-context-menu.html | |
parent | 59024e55e1dea279b8acad3a9a8d2403c8bf3028 (diff) | |
download | canory-fb0eafd272a6cee9b8f9e380cd028f4edde18298.tar.gz canory-fb0eafd272a6cee9b8f9e380cd028f4edde18298.tar.bz2 canory-fb0eafd272a6cee9b8f9e380cd028f4edde18298.zip |
themes/default/layouts/partials: Add plain text
Add plain text version of single. Enhance menu permalink ergonomics. Add href to
date menu anchor.
Diffstat (limited to 'themes/default/layouts/partials/meta-context-menu.html')
-rw-r--r-- | themes/default/layouts/partials/meta-context-menu.html | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/themes/default/layouts/partials/meta-context-menu.html b/themes/default/layouts/partials/meta-context-menu.html index 7269262..1edf80e 100644 --- a/themes/default/layouts/partials/meta-context-menu.html +++ b/themes/default/layouts/partials/meta-context-menu.html @@ -1,18 +1,33 @@ -{{- $id := delimit (shuffle (seq 1 7)) "" -}} +{{- $id := delimit (shuffle (seq 1 7)) "" -}} +{{- $author := index .Site.Data ((or .Params.author .Site.Author.default.user) | default "default") -}} +{{- $href := print .Site.BaseURL "/" $author.user "/messages/" (path.Base .Permalink) "/" -}} +{{- $plain := print .Site.BaseURL "/" $author.user "/messages/" (path.Base .Permalink) "/index.txt" -}} + +{{- with .Params.feed.self -}} + {{- $href = print $.Site.BaseURL "/" $.Params.feed.self -}} + {{- $plain = print $.Site.BaseURL "/" $.Params.feed.self "/index.txt" -}} +{{- end -}} + <micro-metadata-menu> <context-control> <label for="context-metadata-{{ $id }}"> - {{ safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/arrow-down-circle.svg")) }} + {{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/arrow-down-circle.svg")) -}} <span>menu</span> </label> <input hidden type="checkbox" id="context-metadata-{{ $id }}" /> <context-menu right> {{- partial "meta-markdown.html" . -}} {{- partial "meta-permalink.html" . -}} + <micro-metadata-plain> + <a href="{{ $plain }}"> + {{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/file-text.svg")) -}} + <span>plaintext</span> + </a> + </micro-metadata-plain> <micro-metadata-datetime> - <a title="{{ .Date.Local | time.Format "3:04 PM Jan 2 2006" -}}"> + <a title="{{ .Date.Local | time.Format "3:04 PM Jan 2 2006" -}}" href="{{ $href }}"> {{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/calendar.svg")) -}} - {{ .Date.Local | time.Format "Jan 2 2006" | lower -}} + <span>{{ .Date.Local | time.Format "Jan 2 2006" | lower -}}</span> </a> </micro-metadata-datetime> </context-menu> |