aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/_default/drafts.html
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 /themes/default/layouts/_default/drafts.html
parentfab10521fbd303002b5adba8e026e4c8a8e73a44 (diff)
downloadcanory-dff47d17bb0ed4479bfb187b19ba1c8b1fa61226.tar.gz
canory-dff47d17bb0ed4479bfb187b19ba1c8b1fa61226.tar.bz2
canory-dff47d17bb0ed4479bfb187b19ba1c8b1fa61226.zip
themes/default/layouts/_default: Paginate drafts and categorize
Diffstat (limited to 'themes/default/layouts/_default/drafts.html')
-rw-r--r--themes/default/layouts/_default/drafts.html54
1 files changed, 54 insertions, 0 deletions
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 }}