From ec9d8921713a8efae445299ca9a30f741c905da3 Mon Sep 17 00:00:00 2001 From: tdro Date: Sat, 28 Jan 2023 23:19:09 -0500 Subject: themes/default/layouts/_default: Name spacing Make list.html -> index.html and identify sections by name. Ignore Deno vendor folder. --- .gitignore | 1 + themes/default/layouts/_default/drafts.html | 54 ----------------- themes/default/layouts/_default/feeds.html | 50 ---------------- themes/default/layouts/_default/index.html | 37 ++++++++++++ themes/default/layouts/_default/likes.html | 54 ----------------- themes/default/layouts/_default/list.html | 37 ------------ themes/default/layouts/_default/media.html | 68 ---------------------- .../default/layouts/_default/section.drafts.html | 54 +++++++++++++++++ themes/default/layouts/_default/section.feeds.html | 50 ++++++++++++++++ themes/default/layouts/_default/section.likes.html | 54 +++++++++++++++++ themes/default/layouts/_default/section.media.html | 68 ++++++++++++++++++++++ .../default/layouts/partials/generate-authors.html | 8 +-- 12 files changed, 268 insertions(+), 267 deletions(-) delete mode 100644 themes/default/layouts/_default/drafts.html delete mode 100644 themes/default/layouts/_default/feeds.html create mode 100644 themes/default/layouts/_default/index.html delete mode 100644 themes/default/layouts/_default/likes.html delete mode 100644 themes/default/layouts/_default/list.html delete mode 100644 themes/default/layouts/_default/media.html create mode 100644 themes/default/layouts/_default/section.drafts.html create mode 100644 themes/default/layouts/_default/section.feeds.html create mode 100644 themes/default/layouts/_default/section.likes.html create mode 100644 themes/default/layouts/_default/section.media.html diff --git a/.gitignore b/.gitignore index c8f7ee5..b1e3887 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ icons public resources +vendor diff --git a/themes/default/layouts/_default/drafts.html b/themes/default/layouts/_default/drafts.html deleted file mode 100644 index 569af84..0000000 --- a/themes/default/layouts/_default/drafts.html +++ /dev/null @@ -1,54 +0,0 @@ -{{ define "styles" }} -{{ $author := partial "author-user.html" . }} - -{{ end }} - -{{ define "middle" }} - - {{ partial "navigator-middle.html" - (dict - "Title" "Drafts" - "Subtitle" (partial "count-drafts.html" .) - "Icon" "arrow-left" - "IconLabel" "Back" - "Href" "/" - "Id" "back" - "Context" . - ) - }} - - {{ partial "profile.html" . }} - - {{- $author := partial "author-user.html" . -}} - {{- $users := where .Site.RegularPages "Section" $author -}} - {{- $drafts := where .Site.RegularPages "Draft" true -}} - {{- $filteredPages := $users | intersect $drafts -}} - {{- $paginator := .Paginate $filteredPages }} - - {{ range $paginator.Pages }} - {{ .Render "summary" }} - {{ else }} - - {{ end }} - - {{ partial "pagination.html" . }} - -{{ end }} - -{{ define "right" }} - {{- partial "navigator-right.html" . -}} -{{ end }} diff --git a/themes/default/layouts/_default/feeds.html b/themes/default/layouts/_default/feeds.html deleted file mode 100644 index 2845ea0..0000000 --- a/themes/default/layouts/_default/feeds.html +++ /dev/null @@ -1,50 +0,0 @@ -{{ define "styles" }} -{{ $author := partial "author-user.html" . }} - -{{ end }} - -{{ define "middle" }} - - {{ partial "navigator-middle.html" - (dict - "Title" "Feeds" - "Subtitle" (partial "count-feeds.html" .) - "Icon" "arrow-left" - "IconLabel" "Back" - "Href" "/" - "Id" "back" - "Context" . - ) - }} - - {{ partial "profile.html" . }} - - {{ range .Paginator.Pages }} - {{ .Render "summary" }} - {{ else }} - - {{ end }} - - {{ partial "pagination.html" . }} - - {{ $writeToFile := partial "function-generate-feeds" . }} - -{{ end }} - -{{ define "right" }} - {{- partial "navigator-right.html" . -}} -{{ end }} diff --git a/themes/default/layouts/_default/index.html b/themes/default/layouts/_default/index.html new file mode 100644 index 0000000..3fc93ce --- /dev/null +++ b/themes/default/layouts/_default/index.html @@ -0,0 +1,37 @@ +{{ define "styles" }} + +{{ end }} + +{{ define "middle" }} + + {{ partial "navigator-middle.html" + (dict + "Title" "Home" + "Subtitle" (partial "count-total-messages.html" .) + "Context" . + ) + }} + + {{ range .Paginator.Pages }} + {{ .Render "summary" }} + {{ end }} + + {{ partial "pagination.html" . }} + +{{ end }} + +{{ define "right" }} + {{- partial "author-list.html" . -}} + + {{ range first 1 (where .Site.Pages "Params.Author" .Site.Author.default.picturegallery) }} + {{- partial "gallery.html" . -}} + {{ end }} + + {{ range first 1 (where .Site.Pages "Params.Author" .Site.Author.default.webring) }} + {{- partial "following-list.html" . -}} + {{- partial "webring.html" . -}} + {{ end }} + +{{ end }} diff --git a/themes/default/layouts/_default/likes.html b/themes/default/layouts/_default/likes.html deleted file mode 100644 index ccd75fb..0000000 --- a/themes/default/layouts/_default/likes.html +++ /dev/null @@ -1,54 +0,0 @@ -{{ define "styles" }} -{{ $author := partial "author-user.html" . }} - -{{ end }} - -{{ define "middle" }} - - {{ partial "navigator-middle.html" - (dict - "Title" "Likes" - "Subtitle" (partial "count-likes.html" .) - "Icon" "arrow-left" - "IconLabel" "Back" - "Href" "/" - "Id" "back" - "Context" . - ) - }} - - {{ partial "profile.html" . }} - - {{- $author := partial "author-user.html" . -}} - {{- $users := where .Site.RegularPages "Section" $author -}} - {{- $likes := where .Site.RegularPages ".Params.liked" true -}} - {{- $filteredPages := $users | intersect $likes -}} - {{- $paginator := .Paginate $filteredPages }} - - {{ range $paginator.Pages }} - {{ .Render "summary" }} - {{ else }} - - {{ end }} - - {{ partial "pagination.html" . }} - -{{ end }} - -{{ define "right" }} - {{- partial "navigator-right.html" . -}} -{{ end }} diff --git a/themes/default/layouts/_default/list.html b/themes/default/layouts/_default/list.html deleted file mode 100644 index 3fc93ce..0000000 --- a/themes/default/layouts/_default/list.html +++ /dev/null @@ -1,37 +0,0 @@ -{{ define "styles" }} - -{{ end }} - -{{ define "middle" }} - - {{ partial "navigator-middle.html" - (dict - "Title" "Home" - "Subtitle" (partial "count-total-messages.html" .) - "Context" . - ) - }} - - {{ range .Paginator.Pages }} - {{ .Render "summary" }} - {{ end }} - - {{ partial "pagination.html" . }} - -{{ end }} - -{{ define "right" }} - {{- partial "author-list.html" . -}} - - {{ range first 1 (where .Site.Pages "Params.Author" .Site.Author.default.picturegallery) }} - {{- partial "gallery.html" . -}} - {{ end }} - - {{ range first 1 (where .Site.Pages "Params.Author" .Site.Author.default.webring) }} - {{- partial "following-list.html" . -}} - {{- partial "webring.html" . -}} - {{ end }} - -{{ end }} diff --git a/themes/default/layouts/_default/media.html b/themes/default/layouts/_default/media.html deleted file mode 100644 index a140801..0000000 --- a/themes/default/layouts/_default/media.html +++ /dev/null @@ -1,68 +0,0 @@ -{{ define "styles" }} -{{ $author := partial "author-user.html" . }} - -{{ end }} - -{{ define "middle" }} - - {{ partial "navigator-middle.html" - (dict - "Title" "Media" - "Subtitle" (partial "count-media.html" .) - "Icon" "arrow-left" - "IconLabel" "Back" - "Href" "/" - "Id" "back" - "Context" . - ) - }} - - {{ partial "profile.html" . }} - - {{- $author := partial "author-user.html" . -}} - - {{ $count := 0 }} - {{ $result := false }} - - {{ range .Site.Pages }} - {{ if or - (in .Content "
") - (in .Content "") - (in .Content "") - (in .Content "") - }} - {{ if eq .Type $author }} - {{ $result = true }} - {{ $count = add $count 1 }} - {{ if le $count 10 }} - {{ .Render "summary" }} - {{ end }} - {{ end }} - {{ end }} - {{ end }} - - {{ if not $result }} -
- No media found! -
- {{ end }} - - {{ partial "pagination.html" . }} - -{{ end }} - -{{ define "right" }} - {{- partial "navigator-right.html" . -}} -{{ end }} diff --git a/themes/default/layouts/_default/section.drafts.html b/themes/default/layouts/_default/section.drafts.html new file mode 100644 index 0000000..569af84 --- /dev/null +++ b/themes/default/layouts/_default/section.drafts.html @@ -0,0 +1,54 @@ +{{ define "styles" }} +{{ $author := partial "author-user.html" . }} + +{{ end }} + +{{ define "middle" }} + + {{ partial "navigator-middle.html" + (dict + "Title" "Drafts" + "Subtitle" (partial "count-drafts.html" .) + "Icon" "arrow-left" + "IconLabel" "Back" + "Href" "/" + "Id" "back" + "Context" . + ) + }} + + {{ partial "profile.html" . }} + + {{- $author := partial "author-user.html" . -}} + {{- $users := where .Site.RegularPages "Section" $author -}} + {{- $drafts := where .Site.RegularPages "Draft" true -}} + {{- $filteredPages := $users | intersect $drafts -}} + {{- $paginator := .Paginate $filteredPages }} + + {{ range $paginator.Pages }} + {{ .Render "summary" }} + {{ else }} +
+ No drafts found! +
+ {{ end }} + + {{ partial "pagination.html" . }} + +{{ end }} + +{{ define "right" }} + {{- partial "navigator-right.html" . -}} +{{ end }} diff --git a/themes/default/layouts/_default/section.feeds.html b/themes/default/layouts/_default/section.feeds.html new file mode 100644 index 0000000..2845ea0 --- /dev/null +++ b/themes/default/layouts/_default/section.feeds.html @@ -0,0 +1,50 @@ +{{ define "styles" }} +{{ $author := partial "author-user.html" . }} + +{{ end }} + +{{ define "middle" }} + + {{ partial "navigator-middle.html" + (dict + "Title" "Feeds" + "Subtitle" (partial "count-feeds.html" .) + "Icon" "arrow-left" + "IconLabel" "Back" + "Href" "/" + "Id" "back" + "Context" . + ) + }} + + {{ partial "profile.html" . }} + + {{ range .Paginator.Pages }} + {{ .Render "summary" }} + {{ else }} +
+ No feeds found! +
+ {{ end }} + + {{ partial "pagination.html" . }} + + {{ $writeToFile := partial "function-generate-feeds" . }} + +{{ end }} + +{{ define "right" }} + {{- partial "navigator-right.html" . -}} +{{ end }} diff --git a/themes/default/layouts/_default/section.likes.html b/themes/default/layouts/_default/section.likes.html new file mode 100644 index 0000000..ccd75fb --- /dev/null +++ b/themes/default/layouts/_default/section.likes.html @@ -0,0 +1,54 @@ +{{ define "styles" }} +{{ $author := partial "author-user.html" . }} + +{{ end }} + +{{ define "middle" }} + + {{ partial "navigator-middle.html" + (dict + "Title" "Likes" + "Subtitle" (partial "count-likes.html" .) + "Icon" "arrow-left" + "IconLabel" "Back" + "Href" "/" + "Id" "back" + "Context" . + ) + }} + + {{ partial "profile.html" . }} + + {{- $author := partial "author-user.html" . -}} + {{- $users := where .Site.RegularPages "Section" $author -}} + {{- $likes := where .Site.RegularPages ".Params.liked" true -}} + {{- $filteredPages := $users | intersect $likes -}} + {{- $paginator := .Paginate $filteredPages }} + + {{ range $paginator.Pages }} + {{ .Render "summary" }} + {{ else }} +
+ No likes found! +
+ {{ end }} + + {{ partial "pagination.html" . }} + +{{ end }} + +{{ define "right" }} + {{- partial "navigator-right.html" . -}} +{{ end }} diff --git a/themes/default/layouts/_default/section.media.html b/themes/default/layouts/_default/section.media.html new file mode 100644 index 0000000..a140801 --- /dev/null +++ b/themes/default/layouts/_default/section.media.html @@ -0,0 +1,68 @@ +{{ define "styles" }} +{{ $author := partial "author-user.html" . }} + +{{ end }} + +{{ define "middle" }} + + {{ partial "navigator-middle.html" + (dict + "Title" "Media" + "Subtitle" (partial "count-media.html" .) + "Icon" "arrow-left" + "IconLabel" "Back" + "Href" "/" + "Id" "back" + "Context" . + ) + }} + + {{ partial "profile.html" . }} + + {{- $author := partial "author-user.html" . -}} + + {{ $count := 0 }} + {{ $result := false }} + + {{ range .Site.Pages }} + {{ if or + (in .Content "
") + (in .Content "") + (in .Content "") + (in .Content "") + }} + {{ if eq .Type $author }} + {{ $result = true }} + {{ $count = add $count 1 }} + {{ if le $count 10 }} + {{ .Render "summary" }} + {{ end }} + {{ end }} + {{ end }} + {{ end }} + + {{ if not $result }} + + {{ end }} + + {{ partial "pagination.html" . }} + +{{ end }} + +{{ define "right" }} + {{- partial "navigator-right.html" . -}} +{{ end }} diff --git a/themes/default/layouts/partials/generate-authors.html b/themes/default/layouts/partials/generate-authors.html index f622765..61cc5a6 100644 --- a/themes/default/layouts/partials/generate-authors.html +++ b/themes/default/layouts/partials/generate-authors.html @@ -31,7 +31,7 @@ (print "/data/generates/content/" . "/feeds/" "_index.md") (dict "author" . - "layout" "feeds" + "layout" "section.feeds" ) $markdown -}} @@ -41,7 +41,7 @@ (print "/data/generates/content/" . "/media/" "_index.md") (dict "author" . - "layout" "media" + "layout" "section.media" ) $markdown -}} @@ -51,7 +51,7 @@ (print "/data/generates/content/" . "/likes/" "_index.md") (dict "author" . - "layout" "likes" + "layout" "section.likes" ) $markdown -}} @@ -61,7 +61,7 @@ (print "/data/generates/content/" . "/drafts/" "_index.md") (dict "author" . - "layout" "drafts" + "layout" "section.drafts" ) $markdown -}} -- cgit v1.2.3