From 088ff760327f0e7f3d1e4d734442cb1a6b151f64 Mon Sep 17 00:00:00 2001 From: tdro Date: Sat, 30 Dec 2023 16:39:52 -0500 Subject: config: Likes -> Marked --- Makefile | 2 +- assets/css/default.css | 2 +- content/canory/messages/pinned.md | 2 +- static/icons/feather/bookmark.svg | 14 ++++++ static/icons/feather/heart.svg | 14 ------ themes/default/layouts/_default/section.likes.html | 58 ---------------------- themes/default/layouts/_default/section.marks.html | 58 ++++++++++++++++++++++ themes/default/layouts/partials/count-likes.html | 12 ----- themes/default/layouts/partials/count-marks.html | 11 ++++ .../default/layouts/partials/generate-authors.html | 4 +- themes/default/layouts/partials/meta-anchored.html | 10 ++-- themes/default/layouts/partials/profile-tabs.html | 2 +- 12 files changed, 94 insertions(+), 95 deletions(-) create mode 100644 static/icons/feather/bookmark.svg delete mode 100644 static/icons/feather/heart.svg delete mode 100644 themes/default/layouts/_default/section.likes.html create mode 100644 themes/default/layouts/_default/section.marks.html delete mode 100644 themes/default/layouts/partials/count-likes.html create mode 100644 themes/default/layouts/partials/count-marks.html diff --git a/Makefile b/Makefile index 46c86e2..6510793 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ build-icons: # Build icons curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/eye.svg --output-dir static/icons/feather curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/file-text.svg --output-dir static/icons/feather curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/globe.svg --output-dir static/icons/feather - curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/heart.svg --output-dir static/icons/feather + curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/bookmark.svg --output-dir static/icons/feather curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/link.svg --output-dir static/icons/feather curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/map-pin.svg --output-dir static/icons/feather curl --silent --remote-name https://raw.githubusercontent.com/feathericons/feather/master/icons/refresh-cw.svg --output-dir static/icons/feather diff --git a/assets/css/default.css b/assets/css/default.css index 8953f6f..8464f2f 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -1307,7 +1307,7 @@ anchored-pinned svg { fill: #9ed1fa; } -anchored-liked svg { +anchored-marked svg { fill: #cd5c5c; } diff --git a/content/canory/messages/pinned.md b/content/canory/messages/pinned.md index 1e3b219..faf8781 100644 --- a/content/canory/messages/pinned.md +++ b/content/canory/messages/pinned.md @@ -3,7 +3,7 @@ date = "2022-02-05T02:20:51+00:00" lastmod = "2022-03-29T22:55:17+00:00" tags = [ "docs" ] weight = 1 -liked = true +marked = true +++ This message is pinned for reasons unknown. For a quick start guide, diff --git a/static/icons/feather/bookmark.svg b/static/icons/feather/bookmark.svg new file mode 100644 index 0000000..98cc81c --- /dev/null +++ b/static/icons/feather/bookmark.svg @@ -0,0 +1,14 @@ + diff --git a/static/icons/feather/heart.svg b/static/icons/feather/heart.svg deleted file mode 100644 index 850bd6f..0000000 --- a/static/icons/feather/heart.svg +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/themes/default/layouts/_default/section.likes.html b/themes/default/layouts/_default/section.likes.html deleted file mode 100644 index 5626344..0000000 --- a/themes/default/layouts/_default/section.likes.html +++ /dev/null @@ -1,58 +0,0 @@ -{{- define "styles" -}} -{{- $author := partial "function-authors-data.html" . -}} -{{- $author = $author.user -}} - -{{- end -}} - -{{- define "header" -}} - {{- $author := partial "function-authors-data.html" . -}} - {{- $authors := where .Site.RegularPages "Section" $author.user -}} - {{- $likes := where .Site.RegularPages ".Params.liked" true -}} - {{- $filteredPages := $authors | intersect $likes -}} - {{- $paginator := .Paginate $filteredPages -}} - - {{- partial "navigator-middle.html" - (dict - "Context" . - "IconLabel" "Back" - "Id" "back" - "Title" "Likes" - "Icon" "arrow-left" - "Subtitle" (print (partial "count-likes.html" .) " " "Total") - "Href" (or (and (gt $paginator.PageNumber 1) ($paginator.Prev.URL | absURL)) "/") - ) - -}} - - {{- partial "profile.html" . -}} -{{- end -}} - -{{- define "middle" -}} - {{- range .Paginator.Pages -}} - {{- partial "render-embed.html" . -}} - {{- else -}} - - {{- end -}} -{{- end -}} - -{{- define "footer" -}} - {{- partial "pagination.html" . -}} - {{- partial "base-footer.html" . -}} -{{- end -}} - -{{- define "right" -}} - {{- partial "navigator-right.html" . -}} -{{- end -}} diff --git a/themes/default/layouts/_default/section.marks.html b/themes/default/layouts/_default/section.marks.html new file mode 100644 index 0000000..5b6cea0 --- /dev/null +++ b/themes/default/layouts/_default/section.marks.html @@ -0,0 +1,58 @@ +{{- define "styles" -}} +{{- $author := partial "function-authors-data.html" . -}} +{{- $author = $author.user -}} + +{{- end -}} + +{{- define "header" -}} + {{- $author := partial "function-authors-data.html" . -}} + {{- $authors := where .Site.RegularPages "Section" $author.user -}} + {{- $items := where .Site.RegularPages ".Params.marked" true -}} + {{- $filteredPages := $authors | intersect $items -}} + {{- $paginator := .Paginate $filteredPages -}} + + {{- partial "navigator-middle.html" + (dict + "Context" . + "IconLabel" "Back" + "Id" "back" + "Title" "Marks" + "Icon" "arrow-left" + "Subtitle" (print (partial "count-marks.html" .) " " "Total") + "Href" (or (and (gt $paginator.PageNumber 1) ($paginator.Prev.URL | absURL)) "/") + ) + -}} + + {{- partial "profile.html" . -}} +{{- end -}} + +{{- define "middle" -}} + {{- range .Paginator.Pages -}} + {{- partial "render-embed.html" . -}} + {{- else -}} + + {{- end -}} +{{- end -}} + +{{- define "footer" -}} + {{- partial "pagination.html" . -}} + {{- partial "base-footer.html" . -}} +{{- end -}} + +{{- define "right" -}} + {{- partial "navigator-right.html" . -}} +{{- end -}} diff --git a/themes/default/layouts/partials/count-likes.html b/themes/default/layouts/partials/count-likes.html deleted file mode 100644 index e9a2d09..0000000 --- a/themes/default/layouts/partials/count-likes.html +++ /dev/null @@ -1,12 +0,0 @@ -{{- $author := partial "function-authors-data.html" . -}} -{{- $count := 0 -}} - -{{- $likes := where .Site.RegularPages ".Params.liked" true -}} -{{- $authors := where .Site.RegularPages "Section" $author.user -}} -{{- $filteredPages := $authors | intersect $likes -}} - -{{- range $filteredPages -}} - {{- $count = add $count 1 -}} -{{- end -}} - -{{- print (lang.FormatNumberCustom 0 $count) -}} diff --git a/themes/default/layouts/partials/count-marks.html b/themes/default/layouts/partials/count-marks.html new file mode 100644 index 0000000..b251555 --- /dev/null +++ b/themes/default/layouts/partials/count-marks.html @@ -0,0 +1,11 @@ +{{- $count := 0 -}} +{{- $author := .Section -}} +{{- $items := where .Site.RegularPages ".Params.marked" true -}} +{{- $authors := where .Site.RegularPages "Section" $author -}} +{{- $filteredPages := $authors | intersect $items -}} + +{{- range $filteredPages -}} + {{- $count = add $count 1 -}} +{{- end -}} + +{{- print (lang.FormatNumberCustom 0 $count) -}} diff --git a/themes/default/layouts/partials/generate-authors.html b/themes/default/layouts/partials/generate-authors.html index a0fd825..29c991d 100644 --- a/themes/default/layouts/partials/generate-authors.html +++ b/themes/default/layouts/partials/generate-authors.html @@ -48,10 +48,10 @@ {{- $writeToFile := $template.Permalink -}} {{- $template := resources.ExecuteAsTemplate - (print "/data/generates/content/" $author "/likes/" "_index.md") + (print "/data/generates/content/" $author "/marks/" "_index.md") (dict "author" $author - "layout" "section.likes" + "layout" "section.marks" ) $markdown -}} diff --git a/themes/default/layouts/partials/meta-anchored.html b/themes/default/layouts/partials/meta-anchored.html index 31b910f..431fa64 100644 --- a/themes/default/layouts/partials/meta-anchored.html +++ b/themes/default/layouts/partials/meta-anchored.html @@ -9,11 +9,11 @@ {{ end }} - {{ if .Params.Liked }} - - {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/heart.svg")) }} - Liked - + {{ if .Params.Marked }} + + {{ safeHTML (readFile (print (partial "function-paths.html").static "/icons/feather/bookmark.svg")) }} + Marked + {{ end }} {{ end }} diff --git a/themes/default/layouts/partials/profile-tabs.html b/themes/default/layouts/partials/profile-tabs.html index ec87076..1ca632b 100644 --- a/themes/default/layouts/partials/profile-tabs.html +++ b/themes/default/layouts/partials/profile-tabs.html @@ -25,7 +25,7 @@ {{ $label }} -- cgit v1.2.3