From dff47d17bb0ed4479bfb187b19ba1c8b1fa61226 Mon Sep 17 00:00:00 2001 From: tdro Date: Tue, 31 May 2022 21:21:58 -0400 Subject: themes/default/layouts/_default: Paginate drafts and categorize --- assets/css/default.css | 36 ++++++++++----- content/canory/drafts/_index.md | 4 ++ content/canory/messages/drafts.md | 5 +++ content/default/drafts/_index.md | 4 ++ content/default/messages/quickstart.md | 2 +- themes/default/layouts/_default/drafts.html | 54 +++++++++++++++++++++++ themes/default/layouts/_default/home.sources.html | 2 +- themes/default/layouts/partials/count-drafts.html | 10 +++++ themes/default/layouts/partials/profile-tabs.html | 13 ++++-- 9 files changed, 112 insertions(+), 18 deletions(-) create mode 100644 content/canory/drafts/_index.md create mode 100644 content/default/drafts/_index.md create mode 100644 themes/default/layouts/_default/drafts.html create mode 100644 themes/default/layouts/partials/count-drafts.html diff --git a/assets/css/default.css b/assets/css/default.css index 18b1c22..0f81b68 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -61,7 +61,7 @@ --border-darker: #555; --border-lighter: #262626; --button-background: #333; - --danger-background: #220402; + --danger-background: #4f1c1c; --danger: #ff9494; --disabled: #999; --fade: #aaa; @@ -77,7 +77,7 @@ --success: #d5f3c4; --table-row-even-background: #273030; --table-row-odd-background: #2e3838; - --warning-background: #333300; + --warning-background: #42381f; --warning: #ffe699; --widget-background: #262626; } @@ -899,18 +899,24 @@ micro-nsfw details[open] + micro-nsfw-content { } tab-list { + display: inline-block; + overflow-x: auto; + text-overflow: ellipsis; + vertical-align: top; + white-space: nowrap; + width: 100%; +} + +tab-list aside { display: flex; justify-content: center; border-bottom: 1px solid; border-color: #ddd; border-color: var(--border-darker); + min-width: 450px; } -tab-list a:not(:last-child) { - margin-right: 0.5rem; -} - -tab-list a { +tab-list aside a { border-left: 1px solid; border-right: 1px solid; border-top-left-radius: 0.5rem; @@ -920,15 +926,24 @@ tab-list a { border-color: var(--border-darker); color: #555; color: var(--fade); - margin-top: 0.5rem; padding: 0.5rem 1rem; + margin-top: 0.5rem; position: relative; text-decoration: none; top: 1px; border-bottom: 2px solid var(--background); } -tab-list a:hover { +tab-list aside a:not(:last-child) { + margin-right: 0.5rem; +} + +tab-list aside a:last-child { + color: #8f0000; + color: var(--danger); +} + +tab-list aside a:hover { background-color: #eee; background-color: var(--hover-background); color: inherit; @@ -1597,9 +1612,6 @@ kbd { micro-metadata { line-height: inherit; } - tab-list a { - font-size: 80%; - } micro-header section { display: block; } diff --git a/content/canory/drafts/_index.md b/content/canory/drafts/_index.md new file mode 100644 index 0000000..1f319ba --- /dev/null +++ b/content/canory/drafts/_index.md @@ -0,0 +1,4 @@ +--- +author: canory +layout: drafts +--- diff --git a/content/canory/messages/drafts.md b/content/canory/messages/drafts.md index 9deb852..c6caa9f 100644 --- a/content/canory/messages/drafts.md +++ b/content/canory/messages/drafts.md @@ -9,3 +9,8 @@ author = "canory" Draft those messages, you message drafter. Get a feel of how it delivers before committing the deed. Only reveal your drafts in a local environment --- don't write drafts live on the `www` unless you like living on the edge. + +```yaml {options="hl_lines=9-17",caption="Inside your config.toml, config.json, or config.yaml"} +--- +buildDrafts: false +``` diff --git a/content/default/drafts/_index.md b/content/default/drafts/_index.md new file mode 100644 index 0000000..2f08e4c --- /dev/null +++ b/content/default/drafts/_index.md @@ -0,0 +1,4 @@ +--- +author: default +layout: drafts +--- diff --git a/content/default/messages/quickstart.md b/content/default/messages/quickstart.md index 123c3cc..dc52bc3 100644 --- a/content/default/messages/quickstart.md +++ b/content/default/messages/quickstart.md @@ -11,7 +11,7 @@ explaining how to get started. The copy button is broken... GIT CLONE. EXECUTE HUGO TWICE. HUGO VERSION >= 0.94.2. ```shell -git clone --branch 0.3.31 https://www.thedroneely.com/git/thedroneely/canory +git clone --branch 0.4.16 https://www.thedroneely.com/git/thedroneely/canory cd canory hugo && hugo ``` diff --git a/themes/default/layouts/_default/drafts.html b/themes/default/layouts/_default/drafts.html new file mode 100644 index 0000000..635f17b --- /dev/null +++ b/themes/default/layouts/_default/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 }} + + {{ end }} + + {{ partial "pagination.html" . }} + +{{ end }} + +{{ define "right" }} + {{- partial "navigator-right.html" . -}} +{{ end }} diff --git a/themes/default/layouts/_default/home.sources.html b/themes/default/layouts/_default/home.sources.html index 835933d..76c00bb 100644 --- a/themes/default/layouts/_default/home.sources.html +++ b/themes/default/layouts/_default/home.sources.html @@ -101,7 +101,7 @@