aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2022-05-31 21:21:58 -0400
committertdro <tdro@noreply.example.com>2022-05-31 21:21:58 -0400
commitdff47d17bb0ed4479bfb187b19ba1c8b1fa61226 (patch)
treebaf67014b299f1758be5c60a354829df91efa8ad
parentfab10521fbd303002b5adba8e026e4c8a8e73a44 (diff)
downloadcanory-dff47d17bb0ed4479bfb187b19ba1c8b1fa61226.tar.gz
canory-dff47d17bb0ed4479bfb187b19ba1c8b1fa61226.tar.bz2
canory-dff47d17bb0ed4479bfb187b19ba1c8b1fa61226.zip
themes/default/layouts/_default: Paginate drafts and categorize
-rw-r--r--assets/css/default.css36
-rw-r--r--content/canory/drafts/_index.md4
-rw-r--r--content/canory/messages/drafts.md5
-rw-r--r--content/default/drafts/_index.md4
-rw-r--r--content/default/messages/quickstart.md2
-rw-r--r--themes/default/layouts/_default/drafts.html54
-rw-r--r--themes/default/layouts/_default/home.sources.html2
-rw-r--r--themes/default/layouts/partials/count-drafts.html10
-rw-r--r--themes/default/layouts/partials/profile-tabs.html13
9 files changed, 112 insertions, 18 deletions
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" . }}
+<style>
+ {{ partial "styles-navigator.html" (dict "Link" "/") | safeCSS }}
+
+ tab-list a[href="{{ .Site.BaseURL }}/{{ $author }}/drafts/"] {
+ color: #111;
+ color: var(--foreground);
+ display: inherit;
+ font-weight: 700;
+ text-decoration-color: #014cc6;
+ text-decoration-color: var(--link);
+ text-decoration: underline;
+ }
+</style>
+{{ 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 }}
+ <footer>
+ <code>No drafts found!</code>
+ </footer>
+ {{ 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 @@
<footer>
<p>
- Canory Version: 0.3.31
+ Canory Version: 0.4.16
&middot; Dictionary Access by Paul Lutus: <a href="https://arachnoid.com/javascript/dictionary_access.js">GPLv2+ License</a>
&middot; Feather Icons by Cole Bemis: <a href="https://github.com/feathericons/feather/blob/8b5d6802fa8fd1eb3924b465ff718d2fa8d61efe/LICENSE">MIT License</a>
&middot; Tabler Icons by Paweł Kuna: <a href="https://github.com/tabler/tabler-icons/blob/60f39297d0f785f2e8635faca6857b2260b2d164/LICENSE">MIT License</a>
diff --git a/themes/default/layouts/partials/count-drafts.html b/themes/default/layouts/partials/count-drafts.html
new file mode 100644
index 0000000..78b57a5
--- /dev/null
+++ b/themes/default/layouts/partials/count-drafts.html
@@ -0,0 +1,10 @@
+{{ $author := partial "author-user.html" . }}
+{{ $count := 0 }}
+
+{{ range .Site.Pages }}
+ {{ if and (eq .Type $author) .Draft }}
+ {{ $count = add $count 1 }}
+ {{ end }}
+{{ end }}
+
+{{ print (lang.FormatNumberCustom 0 $count) " " "Drafts" }}
diff --git a/themes/default/layouts/partials/profile-tabs.html b/themes/default/layouts/partials/profile-tabs.html
index 66b32c3..9796a6d 100644
--- a/themes/default/layouts/partials/profile-tabs.html
+++ b/themes/default/layouts/partials/profile-tabs.html
@@ -1,8 +1,13 @@
{{ $author := index .Site.Data.authors ((or .Params.author .Site.Author.default.user) | default "default") }}
<tab-list>
- <a href="{{ .Site.BaseURL }}/{{ $author.user }}">Messages</a>
- <a href="{{ .Site.BaseURL }}/{{ $author.user }}/feeds/">Feeds</a>
- <a href="{{ .Site.BaseURL }}/{{ $author.user }}/media/">Media</a>
- <a href="{{ .Site.BaseURL }}/{{ $author.user }}/likes/">Likes</a>
+ <aside>
+ <a href="{{ .Site.BaseURL }}/{{ $author.user }}">Messages</a>
+ <a href="{{ .Site.BaseURL }}/{{ $author.user }}/feeds/">Feeds</a>
+ <a href="{{ .Site.BaseURL }}/{{ $author.user }}/media/">Media</a>
+ <a href="{{ .Site.BaseURL }}/{{ $author.user }}/likes/">Likes</a>
+ {{- if .Site.BuildDrafts }}
+ <a href="{{ .Site.BaseURL }}/{{ $author.user }}/drafts/">Drafts</a>
+ {{- end }}
+ </aside>
</tab-list>