diff options
author | tdro <tdro@noreply.example.com> | 2022-07-09 10:13:53 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2022-07-09 10:13:53 -0400 |
commit | 8e1256308c9c24fa45783a7c0be7ff74a33906ee (patch) | |
tree | b3c62a2f4eb6bfb0a0ac0c8e7563507a2677df6d | |
parent | 2b0c90bcf35d2a68a4ac4aabec6e9c04fd6e234f (diff) | |
download | canory-8e1256308c9c24fa45783a7c0be7ff74a33906ee.tar.gz canory-8e1256308c9c24fa45783a7c0be7ff74a33906ee.tar.bz2 canory-8e1256308c9c24fa45783a7c0be7ff74a33906ee.zip |
themes/default/layouts/partials/card-meta: Add icons
Dry up and normalize white spaces.
22 files changed, 292 insertions, 134 deletions
@@ -35,18 +35,24 @@ icons: svn export --force https://github.com/feathericons/feather/trunk/icons/arrow-left.svg static/icons/feather svn export --force https://github.com/feathericons/feather/trunk/icons/arrow-right.svg static/icons/feather svn export --force https://github.com/feathericons/feather/trunk/icons/arrow-up.svg static/icons/feather + svn export --force https://github.com/feathericons/feather/trunk/icons/at-sign.svg static/icons/feather + svn export --force https://github.com/feathericons/feather/trunk/icons/calendar.svg static/icons/feather svn export --force https://github.com/feathericons/feather/trunk/icons/circle.svg static/icons/feather svn export --force https://github.com/feathericons/feather/trunk/icons/clock.svg static/icons/feather + svn export --force https://github.com/feathericons/feather/trunk/icons/code.svg static/icons/feather svn export --force https://github.com/feathericons/feather/trunk/icons/copy.svg static/icons/feather + svn export --force https://github.com/feathericons/feather/trunk/icons/edit.svg static/icons/feather svn export --force https://github.com/feathericons/feather/trunk/icons/eye-off.svg static/icons/feather + svn export --force https://github.com/feathericons/feather/trunk/icons/file-text.svg static/icons/feather svn export --force https://github.com/feathericons/feather/trunk/icons/git-commit.svg static/icons/feather svn export --force https://github.com/feathericons/feather/trunk/icons/globe.svg static/icons/feather - svn export --force https://github.com/feathericons/feather/trunk/icons/tag.svg static/icons/feather svn export --force https://github.com/feathericons/feather/trunk/icons/heart.svg static/icons/feather svn export --force https://github.com/feathericons/feather/trunk/icons/home.svg static/icons/feather + svn export --force https://github.com/feathericons/feather/trunk/icons/link.svg static/icons/feather svn export --force https://github.com/feathericons/feather/trunk/icons/map-pin.svg static/icons/feather svn export --force https://github.com/feathericons/feather/trunk/icons/rss.svg static/icons/feather svn export --force https://github.com/feathericons/feather/trunk/icons/search.svg static/icons/feather + svn export --force https://github.com/feathericons/feather/trunk/icons/tag.svg static/icons/feather svn export --force https://github.com/feathericons/feather/trunk/icons/trash-2.svg static/icons/feather svn export --force https://github.com/feathericons/feather/trunk/icons/user.svg static/icons/feather svn export --force https://github.com/feathericons/feather/trunk/icons/users.svg static/icons/feather diff --git a/assets/css/default.css b/assets/css/default.css index 157543d..d73a75c 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -708,26 +708,33 @@ micro-metadata h2 { display: inline; } +micro-metadata section { + word-break: break-all; + word-break: break-word; +} + micro-metadata section a { color: inherit; } -micro-metadata expiry-date, -micro-metadata word-limit em, -micro-metadata draft-label em { +micro-metadata section > *:not(:last-child) { + margin-right: 0.5rem; +} + +micro-metadata-expiry, +micro-metadata-draft em, +micro-metadata word-limit em { color: #8f0000; color: var(--danger); font-style: normal; } -micro-metadata draft-label em { +micro-metadata-draft em { font-variant: all-small-caps; } micro-header footer svg, -micro-metadata expiry-date svg, -micro-metadata anchored-entry svg, -micro-metadata unlisted-entry svg { +micro-metadata section svg { height: 1rem; width: 1rem; stroke-width: 0.1rem; @@ -748,23 +755,18 @@ micro-metadata unlisted-entry { } anchored-entry { - display: flex; align-items: center; - margin-bottom: 0.25rem; + color: #111; + color: var(--foreground); + display: flex; + flex-wrap: wrap; + margin-bottom: 0.5rem; margin-top: -0.5rem; + width: 100%; } -anchored-entry svg { - margin-right: 0.25rem; -} - -anchored-entry span { - margin-right: 0.25rem; -} - -anchored-entry span:not(:last-child):after { - content: "\00B7"; - margin-left: 0.25rem; +anchored-entry > * { + margin-right: 0.5rem; } anchored-pinned svg { diff --git a/static/icons/feather/at-sign.svg b/static/icons/feather/at-sign.svg new file mode 100644 index 0000000..0b7fdfb --- /dev/null +++ b/static/icons/feather/at-sign.svg @@ -0,0 +1,14 @@ +<svg + xmlns="http://www.w3.org/2000/svg" + width="24" + height="24" + viewBox="0 0 24 24" + fill="none" + stroke="currentColor" + stroke-width="2" + stroke-linecap="round" + stroke-linejoin="round" +> + <circle cx="12" cy="12" r="4" /> + <path d="M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-3.92 7.94" /> +</svg> diff --git a/static/icons/feather/calendar.svg b/static/icons/feather/calendar.svg new file mode 100644 index 0000000..c002b85 --- /dev/null +++ b/static/icons/feather/calendar.svg @@ -0,0 +1,16 @@ +<svg + xmlns="http://www.w3.org/2000/svg" + width="24" + height="24" + viewBox="0 0 24 24" + fill="none" + stroke="currentColor" + stroke-width="2" + stroke-linecap="round" + stroke-linejoin="round" +> + <rect x="3" y="4" width="18" height="18" rx="2" ry="2" /> + <line x1="16" y1="2" x2="16" y2="6" /> + <line x1="8" y1="2" x2="8" y2="6" /> + <line x1="3" y1="10" x2="21" y2="10" /> +</svg> diff --git a/static/icons/feather/code.svg b/static/icons/feather/code.svg new file mode 100644 index 0000000..da0f522 --- /dev/null +++ b/static/icons/feather/code.svg @@ -0,0 +1,14 @@ +<svg + xmlns="http://www.w3.org/2000/svg" + width="24" + height="24" + viewBox="0 0 24 24" + fill="none" + stroke="currentColor" + stroke-width="2" + stroke-linecap="round" + stroke-linejoin="round" +> + <polyline points="16 18 22 12 16 6" /> + <polyline points="8 6 2 12 8 18" /> +</svg> diff --git a/static/icons/feather/edit.svg b/static/icons/feather/edit.svg new file mode 100644 index 0000000..9294758 --- /dev/null +++ b/static/icons/feather/edit.svg @@ -0,0 +1,14 @@ +<svg + width="24" + height="24" + viewBox="0 0 24 24" + xmlns="http://www.w3.org/2000/svg" + fill="none" + stroke="currentColor" + stroke-width="2" + stroke-linecap="round" + stroke-linejoin="round" +> + <path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" /> + <path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" /> +</svg> diff --git a/static/icons/feather/file-text.svg b/static/icons/feather/file-text.svg new file mode 100644 index 0000000..6cba58c --- /dev/null +++ b/static/icons/feather/file-text.svg @@ -0,0 +1,17 @@ +<svg + xmlns="http://www.w3.org/2000/svg" + width="24" + height="24" + viewBox="0 0 24 24" + fill="none" + stroke="currentColor" + stroke-width="2" + stroke-linecap="round" + stroke-linejoin="round" +> + <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" /> + <polyline points="14 2 14 8 20 8" /> + <line x1="16" y1="13" x2="8" y2="13" /> + <line x1="16" y1="17" x2="8" y2="17" /> + <polyline points="10 9 9 9 8 9" /> +</svg> diff --git a/static/icons/feather/link.svg b/static/icons/feather/link.svg new file mode 100644 index 0000000..645e746 --- /dev/null +++ b/static/icons/feather/link.svg @@ -0,0 +1,14 @@ +<svg + xmlns="http://www.w3.org/2000/svg" + width="24" + height="24" + viewBox="0 0 24 24" + fill="none" + stroke="currentColor" + stroke-width="2" + stroke-linecap="round" + stroke-linejoin="round" +> + <path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" /> + <path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" /> +</svg> diff --git a/static/icons/tabler/book-2.svg b/static/icons/tabler/book-2.svg index f8e33f0..e136c71 100644 --- a/static/icons/tabler/book-2.svg +++ b/static/icons/tabler/book-2.svg @@ -1,5 +1,4 @@ <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-book-2" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> - <desc>Download more icon variants from https://tabler-icons.io/i/book-2</desc> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M19 4v16h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h12z" /> <path d="M19 16h-12a2 2 0 0 0 -2 2" /> diff --git a/static/icons/tabler/clock.svg b/static/icons/tabler/clock.svg index 00f3aa4..fd98984 100644 --- a/static/icons/tabler/clock.svg +++ b/static/icons/tabler/clock.svg @@ -1,5 +1,4 @@ <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-clock" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> - <desc>Download more icon variants from https://tabler-icons.io/i/clock</desc> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <circle cx="12" cy="12" r="9" /> <polyline points="12 7 12 12 15 15" /> diff --git a/static/icons/tabler/pinned.svg b/static/icons/tabler/pinned.svg index 6a2c4dc..fac8252 100644 --- a/static/icons/tabler/pinned.svg +++ b/static/icons/tabler/pinned.svg @@ -1,5 +1,4 @@ <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-pinned" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> - <desc>Download more icon variants from https://tabler-icons.io/i/pinned</desc> <path stroke="none" d="M0 0h24v24H0z" fill="none"/> <path d="M9 4v6l-2 4v2h10v-2l-2 -4v-6" /> <line x1="12" y1="16" x2="12" y2="21" /> diff --git a/themes/default/layouts/partials/card-meta.html b/themes/default/layouts/partials/card-meta.html index 4359586..3c7f411 100644 --- a/themes/default/layouts/partials/card-meta.html +++ b/themes/default/layouts/partials/card-meta.html @@ -15,49 +15,38 @@ {{- end -}} {{ if .Weight }} - <anchored-pinned> - {{ safeHTML (readFile (print (partial "function-paths-static.html") "/icons/tabler/pinned.svg")) }} - </anchored-pinned> - <span>Pinned</span> - {{ end }} + <anchored-pinned> + {{ safeHTML (readFile (print (partial "function-paths-static.html") "/icons/tabler/pinned.svg")) }} + <span>Pinned</span> + </anchored-pinned> + {{ end }} {{ if .Params.Liked }} - <anchored-liked> - {{ safeHTML (readFile (print (partial "function-paths-static.html") "/icons/feather/heart.svg")) }} - </anchored-liked> - <span>Liked</span> - {{ end }} - + <anchored-liked> + {{ safeHTML (readFile (print (partial "function-paths-static.html") "/icons/feather/heart.svg")) }} + <span>Liked</span> + </anchored-liked> + {{ end }} </anchored-entry> {{ end }} {{- partial "meta-name.html" . -}} - · {{ partial "meta-handle.html" . }} + {{- partial "meta-handle.html" . -}} - {{ if .Draft }} - · {{ partial "meta-draft" . -}} - {{ end }} + {{- partial "meta-draft.html" . -}} - · {{- partial "meta-read-time.html" . -}} + {{- partial "meta-read-time.html" . -}} - · {{- partial "meta-word-count.html" . -}} + {{- partial "meta-word-count.html" . -}} - {{ if .Params.Unlisted }} - · <unlisted-entry title="This message is off the record"> - {{ safeHTML (readFile (print (partial "function-paths-static.html") "/icons/feather/eye-off.svg")) }} - <span>unlisted</span></unlisted-entry> - {{ end }} + {{- partial "meta-unlisted.html" . -}} - · {{- partial "meta-date-time.html" . -}} + {{- partial "meta-date-time.html" . -}} - {{- if .ExpiryDate -}} - · {{- partial "meta-expiry-date.html" . -}} - {{- end -}} + {{- partial "meta-expiry-date.html" . -}} - · <cite><a title="#{{ partial "card-id.html" . }}" href="#{{ partial "card-id.html" . }}">#id</a></cite> + {{- partial "meta-link.html" . -}} - {{ if not .ExpiryDate }} - · {{ partial "meta-source.html" . -}} - {{- end -}} + {{- partial "meta-source.html" . -}} </section> diff --git a/themes/default/layouts/partials/meta-date-time.html b/themes/default/layouts/partials/meta-date-time.html index dba333f..6a29955 100644 --- a/themes/default/layouts/partials/meta-date-time.html +++ b/themes/default/layouts/partials/meta-date-time.html @@ -1,18 +1,23 @@ -{{- $author := index .Site.Data ((or .Params.author .Site.Author.default.user) | default "default") -}} +<micro-metadata-datetime> + {{- $author := index .Site.Data ((or .Params.author .Site.Author.default.user) | default "default") -}} + {{- safeHTML (readFile (print (partial "function-paths-static.html") "/icons/feather/calendar.svg")) -}} -{{- with .Params.feed.self -}} -<a href="{{ $.Site.BaseURL }}/{{ . }}"> -{{ else }} -<a href="{{ .Site.BaseURL }}/{{ $author.user }}/messages/{{ path.Base .Permalink }}#{{ partial "card-id.html" . }}"> -{{ end }} - <time - datetime="{{ .Date | time.Format "2006-01-02T15:04:05Z" }}" - title="{{ .Date | time.Format "Posted: Monday, January 2, 2006 at 15:04:05 MST" }} -{{ if .Lastmod.After .Date }}{{ .Lastmod | time.Format "Edited: Monday, January 2, 2006 at 15:04:05 MST" }}{{ end }}"> - {{ (.Date.Local | time.Format "3:04 PM Jan 2 2006") -}} - {{ if .Lastmod.After .Date }} - (edited) - {{- end -}} - </time> + {{- with .Params.feed.self -}} + <a href="{{ $.Site.BaseURL }}/{{ . }}"> + {{ else }} + <a href="{{ .Site.BaseURL }}/{{ $author.user }}/messages/{{ path.Base .Permalink }}#{{ partial "card-id.html" . }}"> + {{ end }} + <time + datetime="{{ .Date | time.Format "2006-01-02T15:04:05Z" }}" + title="{{ .Date | time.Format "Posted: Monday, January 2, 2006 at 15:04:05 MST" }} + {{ if .Lastmod.After .Date }}{{ .Lastmod | time.Format "Edited: Monday, January 2, 2006 at 15:04:05 MST" }}{{ end }}"> + {{ (.Date.Local | time.Format "3:04 PM Jan 2 2006") -}} + {{ if .Lastmod.After .Date }} + (edited) + {{- end -}} + </time> +{{- /* This comment removes trailing newlines and white spaces. */ -}} + </a> +{{- /* This comment removes trailing newlines and white spaces. */ -}} +</micro-metadata-datetime> {{- /* This comment removes trailing newlines and white spaces. */ -}} -</a> diff --git a/themes/default/layouts/partials/meta-draft.html b/themes/default/layouts/partials/meta-draft.html index 87933a5..7a8aacb 100644 --- a/themes/default/layouts/partials/meta-draft.html +++ b/themes/default/layouts/partials/meta-draft.html @@ -1 +1,11 @@ -<draft-label><a href="{{ .Site.BaseURL }}/{{ .Type }}/drafts/"><em>Draft</em></a></draft-label> +{{- if .Draft -}} + <micro-metadata-draft> +{{- /* This comment removes trailing newlines and white spaces. */ -}} + <em> + {{- safeHTML (readFile (print (partial "function-paths-static.html") "/icons/feather/edit.svg")) -}} + <a href="{{ .Site.BaseURL }}/{{ .Type }}/drafts/">Draft</a> +{{- /* This comment removes trailing newlines and white spaces. */ -}} + </em> +{{- /* This comment removes trailing newlines and white spaces. */ -}} + </micro-metadata-draft> +{{- end -}} diff --git a/themes/default/layouts/partials/meta-expiry-date.html b/themes/default/layouts/partials/meta-expiry-date.html index 275e04e..b04dd1f 100644 --- a/themes/default/layouts/partials/meta-expiry-date.html +++ b/themes/default/layouts/partials/meta-expiry-date.html @@ -1,11 +1,15 @@ -{{ $diff := now.Sub .ExpiryDate }} -{{ $duration := lang.FormatNumberCustom 0 (math.Round (mul (div $diff.Hours 24) -1)) }} +{{- if .ExpiryDate -}} + {{- $diff := now.Sub .ExpiryDate -}} + {{- $duration := lang.FormatNumberCustom 0 (math.Round (mul (div $diff.Hours 24) -1)) -}} -<expiry-date> - <time - datetime= "{{ .ExpiryDate | time.Format "2006-01-02T15:04:05Z" }}" - title="Self destructs within {{ $duration }} days ({{ .ExpiryDate | time.Format "Monday, January 2 2006 at 15:04:05 MST" }})"> - {{ safeHTML (readFile (print (partial "function-paths-static.html") "/icons/feather/trash-2.svg")) }} - {{ .ExpiryDate | time.Format "Jan 2 2006" }} - </time> -</expiry-date> + <micro-metadata-expiry> + <time + datetime= "{{- .ExpiryDate | time.Format "2006-01-02T15:04:05Z" -}}" + title="Self destructs within {{ $duration }} days ({{ .ExpiryDate | time.Format "Monday, January 2 2006 at 15:04:05 MST" }})"> + {{- safeHTML (readFile (print (partial "function-paths-static.html") "/icons/feather/trash-2.svg")) -}} + {{- .ExpiryDate | time.Format "Jan 2 2006" -}} +{{- /* This comment removes trailing newlines and white spaces. */ -}} + </time> +{{- /* This comment removes trailing newlines and white spaces. */ -}} + </micro-metadata-expiry> +{{- end -}} diff --git a/themes/default/layouts/partials/meta-handle.html b/themes/default/layouts/partials/meta-handle.html index ee7f975..459877a 100644 --- a/themes/default/layouts/partials/meta-handle.html +++ b/themes/default/layouts/partials/meta-handle.html @@ -1,13 +1,24 @@ -{{- with .Params.feed.domain -}} -<a - title="{{ . }}" - href="http://{{ . }}"> - @{{ . -}} -</a> +{{ $host := (urls.Parse .Site.BaseURL).Host -}} +{{- if (urls.Parse .Site.BaseURL).Host -}} + {{- $host = (urls.Parse .Site.BaseURL).Host -}} {{- else -}} -<a - title="{{ partial "author-user.html" . }}@{{ (urls.Parse .Site.BaseURL).Host }}" - href="{{ .Site.BaseURL }}/{{ partial "author-user.html" . }}/#"> - @{{ (urls.Parse .Site.BaseURL).Host -}} -</a> + {{- $host = "localhost" -}} {{- end -}} + +<micro-metadata-handle> + {{- safeHTML (readFile (print (partial "function-paths-static.html") "/icons/feather/at-sign.svg")) -}} + {{- with .Params.feed.domain -}} + <a + title="{{ . }}" + href="http://{{ . }}"> + {{ . -}} + </a> + {{- else -}} + <a + title="{{ partial "author-user.html" . }}@{{ $host }}" + href="{{ .Site.BaseURL }}/{{ partial "author-user.html" . }}/#"> + {{- $host -}} + </a> + {{- end -}} +</micro-metadata-handle> +{{- /* This comment removes trailing newlines and white spaces. */ -}} diff --git a/themes/default/layouts/partials/meta-link.html b/themes/default/layouts/partials/meta-link.html new file mode 100644 index 0000000..5a5c04a --- /dev/null +++ b/themes/default/layouts/partials/meta-link.html @@ -0,0 +1,13 @@ +<micro-metadata-link> + {{- safeHTML (readFile (print (partial "function-paths-static.html") "/icons/feather/link.svg")) -}} + + <cite> + <a title="#{{ partial "card-id.html" . }}" href="#{{ partial "card-id.html" . }}"> + id +{{- /* This comment removes trailing newlines and white spaces. */ -}} + </a> +{{- /* This comment removes trailing newlines and white spaces. */ -}} + </cite> +{{- /* This comment removes trailing newlines and white spaces. */ -}} +</micro-metadata-link> +{{- /* This comment removes trailing newlines and white spaces. */ -}} diff --git a/themes/default/layouts/partials/meta-name.html b/themes/default/layouts/partials/meta-name.html index eb5990f..2de47eb 100644 --- a/themes/default/layouts/partials/meta-name.html +++ b/themes/default/layouts/partials/meta-name.html @@ -1,9 +1,14 @@ -<h2> - <b> - {{- with .Params.feed.name -}} - {{ . }} - {{- else -}} - {{ partial "author-name.html" . }} - {{- end -}} - </b> -</h2> +<micro-metadata-name> + <h2> + <b> + {{- with .Params.feed.name -}} + {{- . -}} + {{- else -}} + {{- partial "author-name.html" . -}} + {{- end -}} + </b> +{{- /* This comment removes trailing newlines and white spaces. */ -}} + </h2> +{{- /* This comment removes trailing newlines and white spaces. */ -}} +</micro-metadata-name> +{{- /* This comment removes trailing newlines and white spaces. */ -}} diff --git a/themes/default/layouts/partials/meta-read-time.html b/themes/default/layouts/partials/meta-read-time.html index b3b1839..53e541f 100644 --- a/themes/default/layouts/partials/meta-read-time.html +++ b/themes/default/layouts/partials/meta-read-time.html @@ -1,10 +1,17 @@ -{{- $seconds := mul (div .WordCount 180.0) 60.0 -}} -{{- $seconds = printf "%.0f" $seconds -}} +<micro-metadata-readtime> + {{- $seconds := mul (div .WordCount 180.0) 60.0 -}} + {{- $seconds = printf "%.0f" $seconds -}} -{{- if eq $seconds "0" -}} - {{- $seconds = "1" -}} -{{- end -}} + {{- if eq $seconds "0" -}} + {{- $seconds = "1" -}} + {{- end -}} -<read-time title="Takes {{ $seconds }} second{{- if not (eq $seconds "1") -}}s{{- end }} to read"> - {{ $seconds }} sec -</read-time> + {{- safeHTML (readFile (print (partial "function-paths-static.html") "/icons/feather/clock.svg")) -}} + + <read-time title="Takes {{ $seconds }} second{{- if not (eq $seconds "1") -}}s{{- end }} to read"> + {{ $seconds }} sec +{{- /* This comment removes trailing newlines and white spaces. */ -}} + </read-time> +{{- /* This comment removes trailing newlines and white spaces. */ -}} +</micro-metadata-readtime> +{{- /* This comment removes trailing newlines and white spaces. */ -}} diff --git a/themes/default/layouts/partials/meta-source.html b/themes/default/layouts/partials/meta-source.html index a172726..94b3b01 100644 --- a/themes/default/layouts/partials/meta-source.html +++ b/themes/default/layouts/partials/meta-source.html @@ -1,14 +1,19 @@ -{{- $author := index .Site.Data ((or .Params.author .Site.Author.default.user) | default "default") -}} -{{- $source := print $author.user "/messages/" .File.LogicalName -}} +{{- if not .ExpiryDate -}} + <micro-metadata-source> + {{- $author := index .Site.Data ((or .Params.author .Site.Author.default.user) | default "default") -}} + {{- $source := print $author.user "/messages/" .File.LogicalName -}} + {{- safeHTML (readFile (print (partial "function-paths-static.html") "/icons/feather/code.svg")) -}} -<cite> -{{- with .Params.feed.raw -}} -<a title="{{ $.Site.BaseURL }}/{{ . }}" href="{{ $.Site.BaseURL }}/{{ . }}"> -{{- else -}} -<a - href="{{ .Site.BaseURL }}/{{ partial "function-paths-markdown.html" }}/{{ $source }}" - title="{{ .Site.BaseURL }}/{{ partial "function-paths-markdown.html" }}/{{ $source }}"> + <cite> + {{- with .Params.feed.raw -}} + <a title="{{ $.Site.BaseURL }}/{{ . }}" href="{{ $.Site.BaseURL }}/{{ . }}"> + {{- else -}} + <a + href="{{ .Site.BaseURL }}/{{ partial "function-paths-markdown.html" }}/{{ $source }}" + title="{{ .Site.BaseURL }}/{{ partial "function-paths-markdown.html" }}/{{ $source }}"> + {{- end -}} + raw + </a> + </cite> + </micro-metadata-source> {{- end -}} - raw -</a> -</cite> diff --git a/themes/default/layouts/partials/meta-unlisted.html b/themes/default/layouts/partials/meta-unlisted.html new file mode 100644 index 0000000..a82dad0 --- /dev/null +++ b/themes/default/layouts/partials/meta-unlisted.html @@ -0,0 +1,7 @@ +{{- if .Params.Unlisted -}} + <unlisted-entry title="This message is off the record"> + {{- safeHTML (readFile (print (partial "function-paths-static.html") "/icons/feather/eye-off.svg")) -}} + <span>unlisted</span> +{{- /* This comment removes trailing newlines and white spaces. */ -}} + </unlisted-entry> +{{- end -}} diff --git a/themes/default/layouts/partials/meta-word-count.html b/themes/default/layouts/partials/meta-word-count.html index d4a4065..1c44c78 100644 --- a/themes/default/layouts/partials/meta-word-count.html +++ b/themes/default/layouts/partials/meta-word-count.html @@ -1,14 +1,22 @@ -{{ $author := index .Site.Data ((or .Params.author .Site.Author.default.user) | default "default") }} -{{ $limit := $author.wordlimit }} -{{ $wordLimit := gt .WordCount $limit }} -{{ $overLimit := sub .WordCount $limit }} +<micro-metadata-wordcount> + {{- $author := index .Site.Data ((or .Params.author .Site.Author.default.user) | default "default") -}} + {{- $limit := $author.wordlimit -}} + {{- $wordLimit := gt .WordCount $limit -}} + {{- $overLimit := sub .WordCount $limit -}} + {{- safeHTML (readFile (print (partial "function-paths-static.html") "/icons/feather/file-text.svg")) -}} -<word-limit title="{{- if $wordLimit -}}{{ $overLimit }} words over the limit{{ else }} {{ .WordCount }} words {{ end }}"> - <word-count> - {{- if $wordLimit -}} - <em>{{ .WordCount }}</em> - {{- else -}} - {{ .WordCount }} - {{- end -}} - </word-count>/{{ $limit }} words -</word-limit> + <word-limit title="{{- if $wordLimit -}} {{ $overLimit }} words over the limit {{- else -}} {{ .WordCount }} words {{- end -}}"> + <word-count> + {{- if $wordLimit -}} + <em>{{ .WordCount }}</em> + {{- else -}} + {{ .WordCount }} + {{- end -}} + /{{ $limit }} words +{{- /* This comment removes trailing newlines and white spaces. */ -}} + </word-count> +{{- /* This comment removes trailing newlines and white spaces. */ -}} + </word-limit> +{{- /* This comment removes trailing newlines and white spaces. */ -}} +</micro-metadata-wordcount> +{{- /* This comment removes trailing newlines and white spaces. */ -}} |