From ea26f5f68b7ae91114c4ba2be70a13200191ce8d Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Wed, 7 Aug 2024 07:43:50 -1000 Subject: [PATCH] Blog: Move blog styles and content templates to the base repo --- assets/css/099_page_navigation.css | 35 +++++++++++++++++++ layouts/blog/list.html | 21 +++++++++++ layouts/blog/single.html | 18 ++++++++++ .../partials/page/prev_next_navigation.html | 20 +++++++++++ layouts/partials/page/taxonomy_list.html | 12 ++++--- 5 files changed, 101 insertions(+), 5 deletions(-) create mode 100644 assets/css/099_page_navigation.css create mode 100644 layouts/blog/list.html create mode 100644 layouts/blog/single.html create mode 100644 layouts/partials/page/prev_next_navigation.html diff --git a/assets/css/099_page_navigation.css b/assets/css/099_page_navigation.css new file mode 100644 index 0000000..b6d2a1a --- /dev/null +++ b/assets/css/099_page_navigation.css @@ -0,0 +1,35 @@ + + + + + +/****************** + # PAGE NAVIGATION + ******************/ + +.page-navigation { + list-style: none; + padding-inline: 0; + + &:has(.next-page:only-child) { + justify-content: flex-end; + } + + li { + display: block; + } + + .next-page { + text-align: right; + } + + .previous-page::before { + content: "←"; + padding-inline-end: var(--space-s); + } + + .next-page::after { + content: "→"; + padding-inline-start: var(--space-s); + } +} diff --git a/layouts/blog/list.html b/layouts/blog/list.html new file mode 100644 index 0000000..0569825 --- /dev/null +++ b/layouts/blog/list.html @@ -0,0 +1,21 @@ +{{ define "head_css" }} + {{ partialCached "blog/css.html" . }} +{{ end }} + +{{ define "main" }} +
+ + +
+ {{ .Content }} +
+ +
+ {{ range .Pages.ByDate.Reverse }} + {{ .Render "page_summary" }} + {{ end }} +
+
+{{ end }} diff --git a/layouts/blog/single.html b/layouts/blog/single.html new file mode 100644 index 0000000..fd88cc5 --- /dev/null +++ b/layouts/blog/single.html @@ -0,0 +1,18 @@ +{{ define "head_css" }} + {{ partialCached "blog/css.html" . }} +{{ end }} + +{{ define "main" }} +
+ + + {{ .Content }} + +
+ {{ partial "page/footer.html" . }} + {{ partial "page/prev_next_navigation.html" . }} +
+
+{{ end }} diff --git a/layouts/partials/page/prev_next_navigation.html b/layouts/partials/page/prev_next_navigation.html new file mode 100644 index 0000000..b584cfa --- /dev/null +++ b/layouts/partials/page/prev_next_navigation.html @@ -0,0 +1,20 @@ +{{ if .Section }} + {{- $previousInSection := .PrevInSection -}} + {{- $nextInSection := .NextInSection -}} + + {{ if or $previousInSection $nextInSection }} + + {{ end }} +{{ end }} diff --git a/layouts/partials/page/taxonomy_list.html b/layouts/partials/page/taxonomy_list.html index 0fac27a..fc5df6d 100644 --- a/layouts/partials/page/taxonomy_list.html +++ b/layouts/partials/page/taxonomy_list.html @@ -1,11 +1,13 @@ -{{/* -Generates a list of the terms for a given taxonomy. +{{- /* + Generates a list of the terms for a given taxonomy. -@param {Page} .page The current page -@param {String} .taxonomy The name of the taxonomy -*/}} + @context {Page} .page The current page + @context {String} .taxonomy The name of the taxonomy + +*/ -}} {{- $taxonomy := .taxonomy -}} + {{ with .page.GetTerms $taxonomy }} {{- $name := $taxonomy -}} {{- with T $taxonomy (len .) }}