aboutsummaryrefslogtreecommitdiff
path: root/themes
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2022-08-16 02:01:07 -0400
committertdro <tdro@noreply.example.com>2022-08-16 02:01:07 -0400
commitfb0eafd272a6cee9b8f9e380cd028f4edde18298 (patch)
treebcfea7c1cd10b4256cc5b2b062d68cbb0005db63 /themes
parent59024e55e1dea279b8acad3a9a8d2403c8bf3028 (diff)
downloadcanory-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')
-rw-r--r--themes/default/layouts/_default/single.plain.txt1
-rw-r--r--themes/default/layouts/partials/meta-context-menu.html23
-rw-r--r--themes/default/layouts/partials/meta-view.html13
3 files changed, 26 insertions, 11 deletions
diff --git a/themes/default/layouts/_default/single.plain.txt b/themes/default/layouts/_default/single.plain.txt
new file mode 100644
index 0000000..d110b5e
--- /dev/null
+++ b/themes/default/layouts/_default/single.plain.txt
@@ -0,0 +1 @@
+{{- .Content | plainify | htmlUnescape -}}
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>
diff --git a/themes/default/layouts/partials/meta-view.html b/themes/default/layouts/partials/meta-view.html
index d76798d..a327f78 100644
--- a/themes/default/layouts/partials/meta-view.html
+++ b/themes/default/layouts/partials/meta-view.html
@@ -1,14 +1,13 @@
{{- $author := index .Site.Data ((or .Params.author .Site.Author.default.user) | default "default") -}}
+{{- $href := print .Site.BaseURL "/" $author.user "/messages/" (path.Base .Permalink) "/" -}}
+
+{{- with .Params.feed.self -}}
+ {{- $href = print $.Site.BaseURL "/" $.Params.feed.self -}}
+{{- end -}}
<micro-metadata-view>
{{- /* This comment removes trailing newlines and white spaces. */ -}}
- <a
- {{ with .Params.feed.self -}}
- href="{{ $.Site.BaseURL }}/{{ . }}"
- {{ else }}
- href="{{ .Site.BaseURL }}/{{ $author.user }}/messages/{{ path.Base .Permalink }}/#{{ partial "card-id.html" . }}"
- {{ end }}
- >
+ <a href="{{ $href }}">
{{- safeHTML (readFile (print (partial "function-paths.html" "static") "/icons/feather/external-link.svg")) -}}
<span>view</span>
{{- /* This comment removes trailing newlines and white spaces. */ -}}