From 8e1256308c9c24fa45783a7c0be7ff74a33906ee Mon Sep 17 00:00:00 2001 From: tdro Date: Sat, 9 Jul 2022 10:13:53 -0400 Subject: themes/default/layouts/partials/card-meta: Add icons Dry up and normalize white spaces. --- Makefile | 8 +++- assets/css/default.css | 42 ++++++++++--------- static/icons/feather/at-sign.svg | 14 +++++++ static/icons/feather/calendar.svg | 16 +++++++ static/icons/feather/code.svg | 14 +++++++ static/icons/feather/edit.svg | 14 +++++++ static/icons/feather/file-text.svg | 17 ++++++++ static/icons/feather/link.svg | 14 +++++++ static/icons/tabler/book-2.svg | 1 - static/icons/tabler/clock.svg | 1 - static/icons/tabler/pinned.svg | 1 - themes/default/layouts/partials/card-meta.html | 49 +++++++++------------- .../default/layouts/partials/meta-date-time.html | 37 +++++++++------- themes/default/layouts/partials/meta-draft.html | 12 +++++- .../default/layouts/partials/meta-expiry-date.html | 24 ++++++----- themes/default/layouts/partials/meta-handle.html | 33 ++++++++++----- themes/default/layouts/partials/meta-link.html | 13 ++++++ themes/default/layouts/partials/meta-name.html | 23 ++++++---- .../default/layouts/partials/meta-read-time.html | 23 ++++++---- themes/default/layouts/partials/meta-source.html | 29 +++++++------ themes/default/layouts/partials/meta-unlisted.html | 7 ++++ .../default/layouts/partials/meta-word-count.html | 34 +++++++++------ 22 files changed, 292 insertions(+), 134 deletions(-) create mode 100644 static/icons/feather/at-sign.svg create mode 100644 static/icons/feather/calendar.svg create mode 100644 static/icons/feather/code.svg create mode 100644 static/icons/feather/edit.svg create mode 100644 static/icons/feather/file-text.svg create mode 100644 static/icons/feather/link.svg create mode 100644 themes/default/layouts/partials/meta-link.html create mode 100644 themes/default/layouts/partials/meta-unlisted.html diff --git a/Makefile b/Makefile index 09ce88e..0f528d9 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ + + + + 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 @@ + + + + + + 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 @@ + + + + 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 @@ + + + + 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 @@ + + + + + + + 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 @@ + + + + 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 @@ - Download more icon variants from https://tabler-icons.io/i/book-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 @@ - Download more icon variants from https://tabler-icons.io/i/clock 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 @@ - Download more icon variants from https://tabler-icons.io/i/pinned 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 }} - - {{ safeHTML (readFile (print (partial "function-paths-static.html") "/icons/tabler/pinned.svg")) }} - - Pinned - {{ end }} + + {{ safeHTML (readFile (print (partial "function-paths-static.html") "/icons/tabler/pinned.svg")) }} + Pinned + + {{ end }} {{ if .Params.Liked }} - - {{ safeHTML (readFile (print (partial "function-paths-static.html") "/icons/feather/heart.svg")) }} - - Liked - {{ end }} - + + {{ safeHTML (readFile (print (partial "function-paths-static.html") "/icons/feather/heart.svg")) }} + Liked + + {{ end }} {{ 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 }} - · - {{ safeHTML (readFile (print (partial "function-paths-static.html") "/icons/feather/eye-off.svg")) }} - unlisted - {{ 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" . -}} - · #id + {{- partial "meta-link.html" . -}} - {{ if not .ExpiryDate }} - · {{ partial "meta-source.html" . -}} - {{- end -}} + {{- partial "meta-source.html" . -}} 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") -}} + + {{- $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 -}} - -{{ else }} - -{{ end }} - + {{- with .Params.feed.self -}} + + {{ else }} + + {{ end }} + +{{- /* This comment removes trailing newlines and white spaces. */ -}} + +{{- /* This comment removes trailing newlines and white spaces. */ -}} + {{- /* This comment removes trailing newlines and white spaces. */ -}} - 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 +{{- if .Draft -}} + +{{- /* This comment removes trailing newlines and white spaces. */ -}} + + {{- safeHTML (readFile (print (partial "function-paths-static.html") "/icons/feather/edit.svg")) -}} + Draft +{{- /* This comment removes trailing newlines and white spaces. */ -}} + +{{- /* This comment removes trailing newlines and white spaces. */ -}} + +{{- 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)) -}} - - - + + +{{- /* This comment removes trailing newlines and white spaces. */ -}} + +{{- 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 -}} - - @{{ . -}} - +{{ $host := (urls.Parse .Site.BaseURL).Host -}} +{{- if (urls.Parse .Site.BaseURL).Host -}} + {{- $host = (urls.Parse .Site.BaseURL).Host -}} {{- else -}} - - @{{ (urls.Parse .Site.BaseURL).Host -}} - + {{- $host = "localhost" -}} {{- end -}} + + + {{- safeHTML (readFile (print (partial "function-paths-static.html") "/icons/feather/at-sign.svg")) -}} + {{- with .Params.feed.domain -}} + + {{ . -}} + + {{- else -}} + + {{- $host -}} + + {{- end -}} + +{{- /* 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 @@ + + {{- safeHTML (readFile (print (partial "function-paths-static.html") "/icons/feather/link.svg")) -}} + + + + id +{{- /* This comment removes trailing newlines and white spaces. */ -}} + +{{- /* This comment removes trailing newlines and white spaces. */ -}} + +{{- /* This comment removes trailing newlines and white spaces. */ -}} + +{{- /* 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 @@ -

- - {{- with .Params.feed.name -}} - {{ . }} - {{- else -}} - {{ partial "author-name.html" . }} - {{- end -}} - -

+ +

+ + {{- with .Params.feed.name -}} + {{- . -}} + {{- else -}} + {{- partial "author-name.html" . -}} + {{- end -}} + +{{- /* This comment removes trailing newlines and white spaces. */ -}} +

+{{- /* This comment removes trailing newlines and white spaces. */ -}} +
+{{- /* 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 -}} + + {{- $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 -}} - - {{ $seconds }} sec - + {{- safeHTML (readFile (print (partial "function-paths-static.html") "/icons/feather/clock.svg")) -}} + + + {{ $seconds }} sec +{{- /* This comment removes trailing newlines and white spaces. */ -}} + +{{- /* This comment removes trailing newlines and white spaces. */ -}} + +{{- /* 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 -}} + + {{- $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")) -}} - -{{- with .Params.feed.raw -}} - -{{- else -}} - + + {{- with .Params.feed.raw -}} + + {{- else -}} + + {{- end -}} + raw + + + {{- end -}} - raw - - 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 -}} + + {{- safeHTML (readFile (print (partial "function-paths-static.html") "/icons/feather/eye-off.svg")) -}} + unlisted +{{- /* This comment removes trailing newlines and white spaces. */ -}} + +{{- 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 }} + + {{- $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")) -}} - - - {{- if $wordLimit -}} - {{ .WordCount }} - {{- else -}} - {{ .WordCount }} - {{- end -}} - /{{ $limit }} words - + + + {{- if $wordLimit -}} + {{ .WordCount }} + {{- else -}} + {{ .WordCount }} + {{- end -}} + /{{ $limit }} words +{{- /* This comment removes trailing newlines and white spaces. */ -}} + +{{- /* This comment removes trailing newlines and white spaces. */ -}} + +{{- /* This comment removes trailing newlines and white spaces. */ -}} + +{{- /* This comment removes trailing newlines and white spaces. */ -}} -- cgit v1.2.3