From 171fa015f1357a012f37e1d87ae95ee4a752e310 Mon Sep 17 00:00:00 2001 From: jtbx Date: Sun, 8 Oct 2023 00:13:18 +0200 Subject: [PATCH] Blog: List page with summary and pagination --- README.md | 3 + content/blog/test-event-future.md | 10 +- content/blog/test-event-future2.md | 2 +- content/blog/test-event.md | 4 +- content/blog/test-post.md | 2 +- themes/ccchh/assets/sass/main.scss | 45 +++++ themes/ccchh/layouts/_default/list.html | 1 - themes/ccchh/layouts/_default/summary.html | 13 ++ themes/ccchh/layouts/_default/term.html | 12 +- themes/ccchh/layouts/_default/terms.html | 8 +- themes/ccchh/layouts/blog/list.html | 25 +-- themes/ccchh/layouts/blog/single.html | 19 +-- .../ccchh/layouts/partials/blog-header.html | 37 +++++ themes/ccchh/layouts/partials/pagination.html | 154 ++++++++++++++++++ 14 files changed, 282 insertions(+), 53 deletions(-) create mode 100644 themes/ccchh/layouts/_default/summary.html create mode 100644 themes/ccchh/layouts/partials/blog-header.html create mode 100644 themes/ccchh/layouts/partials/pagination.html diff --git a/README.md b/README.md index eba84e7..7ea9431 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,9 @@ To create a new general blog post, run a command like this: hugo new content --kind article blog/your-article-title.md ``` +By default the first 70 words are shown as a summary on list pages. +Please use `` to manually separate the summary from other post content. + ### Icons You can use solid and brand icons from https://fontawesome.com/icons version 6 in your posts like this: diff --git a/content/blog/test-event-future.md b/content/blog/test-event-future.md index 917a838..2ec666e 100644 --- a/content/blog/test-event-future.md +++ b/content/blog/test-event-future.md @@ -6,9 +6,15 @@ publishDate: 2023-08-27T09:03:20+02:00 # when to publish draft: false location: Z9 authors: - - jtbx - Ada Lovelace --- This is **bold** text, and this is *emphasized* text. -Visit the [Hugo](https://gohugo.io) website! \ No newline at end of file +Visit the [Hugo](https://gohugo.io) website! + +Rem qui qui dolores sit. Ut sequi doloribus nobis et eaque. Voluptas deserunt aut explicabo exercitationem. +Recusandae qui libero corporis in et voluptatem neque quas. Eius quaerat repellendus minus et. Ut est magnam aut vitae maiores deserunt cumque ut. Quia et ad atque consequuntur magnam odit. + +Magnam ipsam sed ratione. Voluptates voluptas facilis quas quia rerum reiciendis. Laborum aspernatur molestiae at quibusdam eligendi fuga voluptas molestiae. +Sint recusandae fugiat ut dolore. A culpa sapiente soluta quis quis assumenda ratione. Nulla rem et quis corrupti dolorem. Ea odio nobis qui. Non dolorum tempora explicabo pariatur a accusantium sint id. Reiciendis omnis nam aut. +Quia ut asperiores eos earum assumenda ratione voluptatem aliquid. Quod delectus et blanditiis aspernatur. Et nemo est ducimus voluptas ut excepturi excepturi ea. Harum et natus culpa velit. diff --git a/content/blog/test-event-future2.md b/content/blog/test-event-future2.md index 29e2995..bd7b74b 100644 --- a/content/blog/test-event-future2.md +++ b/content/blog/test-event-future2.md @@ -16,4 +16,4 @@ Rem qui qui dolores sit. Ut sequi doloribus nobis et eaque. Voluptas deserunt au Recusandae qui libero corporis in et voluptatem neque quas. Eius quaerat repellendus minus et. Ut est magnam aut vitae maiores deserunt cumque ut. Quia et ad atque consequuntur magnam odit. Magnam ipsam sed ratione. Voluptates voluptas facilis quas quia rerum reiciendis. Laborum aspernatur molestiae at quibusdam eligendi fuga voluptas molestiae. Sint recusandae fugiat ut dolore. A culpa sapiente soluta quis quis assumenda ratione. Nulla rem et quis corrupti dolorem. Ea odio nobis qui. Non dolorum tempora explicabo pariatur a accusantium sint id. Reiciendis omnis nam aut. -Quia ut asperiores eos earum assumenda ratione voluptatem aliquid. Quod delectus et blanditiis aspernatur. Et nemo est ducimus voluptas ut excepturi excepturi ea. Harum et natus culpa velit. \ No newline at end of file +Quia ut asperiores eos earum assumenda ratione voluptatem aliquid. Quod delectus et blanditiis aspernatur. Et nemo est ducimus voluptas ut excepturi excepturi ea. Harum et natus culpa velit. diff --git a/content/blog/test-event.md b/content/blog/test-event.md index bc583aa..483e305 100644 --- a/content/blog/test-event.md +++ b/content/blog/test-event.md @@ -10,7 +10,9 @@ authors: - Ada Lovelace tags: - test + - bar + - foo --- This is **bold** text, and this is *emphasized* text. -Visit the [Hugo](https://gohugo.io) website! \ No newline at end of file +Visit the [Hugo](https://gohugo.io) website! diff --git a/content/blog/test-post.md b/content/blog/test-post.md index 50931a4..c42545f 100644 --- a/content/blog/test-post.md +++ b/content/blog/test-post.md @@ -11,4 +11,4 @@ tags: --- This is **bold** text, and this is *emphasized* text. -Visit the [Hugo](https://gohugo.io) website! \ No newline at end of file +Visit the [Hugo](https://gohugo.io) website! diff --git a/themes/ccchh/assets/sass/main.scss b/themes/ccchh/assets/sass/main.scss index 969eaf9..fb6de71 100644 --- a/themes/ccchh/assets/sass/main.scss +++ b/themes/ccchh/assets/sass/main.scss @@ -2,6 +2,9 @@ $roomstate_color_unknown: #dda218; $roomstate_color_open: var(--ins-color); $roomstate_color_closed: var(--del-color); +:root { + --spacing: 0.7rem; +} // General Customizations header { @@ -10,6 +13,10 @@ header { h1 { margin-bottom: 0; } + + h2 { + margin-bottom: 0; + } } body>footer { @@ -31,6 +38,44 @@ body>main { } } +.li-space { + &::after { + content: ""; + padding-right: 1rem; + } + + &:last-child::after { + padding-right: 0; + } +} + +.morelink { + margin-top: calc(var(--typography-spacing-vertical) * -1); +} + +.pagination { + display: flex; + justify-content: center; + + li { + list-style: none; + + a { + border-radius: 0; + } + + &:first-child>a { + border-top-left-radius: var(--border-radius); + border-bottom-left-radius: var(--border-radius); + } + + &:last-child>a { + border-top-right-radius: var(--border-radius); + border-bottom-right-radius: var(--border-radius); + } + } +} + // Room State in Menu #roomstate { diff --git a/themes/ccchh/layouts/_default/list.html b/themes/ccchh/layouts/_default/list.html index e8eb091..1818f69 100644 --- a/themes/ccchh/layouts/_default/list.html +++ b/themes/ccchh/layouts/_default/list.html @@ -6,7 +6,6 @@