From abdd02ed2ab61829b810b3525995dde4578f4b98 Mon Sep 17 00:00:00 2001 From: danix Date: Thu, 9 Mar 2023 11:38:48 +0100 Subject: [PATCH] added list page for categories --- assets/sass/components/_image.scss | 8 ++++ assets/sass/components/_spotlights.scss | 1 + layouts/categories/list-baseof.html | 28 ++++++++++++++ layouts/categories/list.html | 51 +++++++++++++++++++++++++ layouts/home-baseof.html | 2 +- layouts/partials/footer.html | 2 +- layouts/partials/header.html | 2 +- 7 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 layouts/categories/list-baseof.html create mode 100644 layouts/categories/list.html diff --git a/assets/sass/components/_image.scss b/assets/sass/components/_image.scss index 6b6fdb3..45df867 100644 --- a/assets/sass/components/_image.scss +++ b/assets/sass/components/_image.scss @@ -129,4 +129,12 @@ width: 350px; } } + } + .section-blog { + .spotlights { + .image { + max-height: 20em; + overflow: hidden; + } + } } \ No newline at end of file diff --git a/assets/sass/components/_spotlights.scss b/assets/sass/components/_spotlights.scss index 882ebe4..a9e9476 100644 --- a/assets/sass/components/_spotlights.scss +++ b/assets/sass/components/_spotlights.scss @@ -14,6 +14,7 @@ } > section { + overflow: hidden; @include vendor('display', 'flex'); @include vendor('flex-direction', 'row'); background-color: desaturate(lighten(_palette_light(bg-alt), 2), 1); diff --git a/layouts/categories/list-baseof.html b/layouts/categories/list-baseof.html new file mode 100644 index 0000000..bfb6c1a --- /dev/null +++ b/layouts/categories/list-baseof.html @@ -0,0 +1,28 @@ + + + {{- partial "head.html" . -}} + + +
+ {{- partial "header.html" . -}} + + + +
+ {{- block "category-list" . }}{{- end }} +
+ {{- partial "footer.html" . -}} +
+ {{- partial "footer-addition.html" . -}} + + + diff --git a/layouts/categories/list.html b/layouts/categories/list.html new file mode 100644 index 0000000..dbc5c92 --- /dev/null +++ b/layouts/categories/list.html @@ -0,0 +1,51 @@ +{{ define "category-list" }} +
+
+
+

Category: {{ .Title }}

+
+

Here you'll find all my articles related to {{ .Title }}. Enjoy.

+
+
+
+ + {{ range .Paginator.Pages }} +
+ + {{ if isset .Params "featured_image" }} + {{.Title}} + {{ else }} + {{ $default_image := resources.Get "img/default_article.jpg" }} + {{.Title}} + {{ end }} + +
+
+
+

+ {{ if gt (len .Title) 40 }} + {{ $first50 := ( substr .Title 0 40 ) }} + {{ $lastChars := ( substr .Title 40 ) }} + {{ $newLine := "
" }} + {{ $newTitle := ( printf "%s" $lastChars | printf "%s%s" $newLine | printf "%s%s" $first50 ) }} + {{ $newTitle | safeHTML }} + {{ else }} + {{ .Title }} + {{ end }} +

+
+

{{ .Params.excerpt }}

+ +
+
+
+ {{ end }} +
+
+
+ {{ partial "pagination.html" . }} +
+
+{{ end }} diff --git a/layouts/home-baseof.html b/layouts/home-baseof.html index 5d3a050..8f9a800 100644 --- a/layouts/home-baseof.html +++ b/layouts/home-baseof.html @@ -5,7 +5,7 @@
{{- partial "header.html" . -}} -