From 4d5f0f30cb402978e5a6b5b2648b7a707761ef14 Mon Sep 17 00:00:00 2001 From: Brandon Rozek Date: Wed, 23 Nov 2022 00:56:13 -0500 Subject: [PATCH] Spicing up blog list and tag list pages --- assets/css/style.css | 56 ++++++++++++++++++++++++++------- layouts/blog/list.html | 12 ++++++- layouts/partials/tags/all.html | 2 +- layouts/partials/tags/page.html | 2 +- layouts/tags/list.html | 8 +++-- layouts/tags/single.html | 2 +- layouts/tags/terms.html | 21 ++++++++++++- 7 files changed, 83 insertions(+), 20 deletions(-) diff --git a/assets/css/style.css b/assets/css/style.css index a7e727f..8ac4e73 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -65,7 +65,7 @@ a:active { align-items: center; margin-left: auto; margin-right: auto; - max-width: 800px; + max-width: 1000px; } .header-top .title { margin-right: 1rem; max-width: 400px; } @@ -121,7 +121,6 @@ mark { #searchBox { position: relative; - max-width: 300px; height: 30px; margin: 20px auto; } @@ -137,7 +136,7 @@ mark { bottom: 0; border-radius: 15px; outline: 0; - font-size: 15px; + /* font-size: 15px; */ color: #707070; background-color:#f6f6f6; border: solid 1px #c9c9c9; @@ -159,10 +158,10 @@ mark { #searchResults { display: none; position: absolute; - max-width: 600px; + max-width: 1000px; /* min-width: 300px; */ margin: 0 auto; - top: 330px; + top: 230px; left: 0; right: 0; padding: 5px; @@ -195,16 +194,22 @@ mark { /* ** TAGS */ -#tags ul { +.tags { + text-align: left; +} +.tags ul { margin: 0 auto; display: flex; padding: 0; - justify-content: center; flex-wrap: wrap; list-style: none; } -#tags li a { +.tags-page ul { + justify-content: center; +} + +.tags li a { display: block; height: 24px; margin: 5px; @@ -216,7 +221,7 @@ mark { text-decoration: none; } -#tags li a:hover { +.tags li a:hover { border: 1px solid black; } @@ -231,6 +236,7 @@ mark { margin-left: auto; margin-right: auto; max-width: 650px; + text-align: left; } .bloglist-date { @@ -240,10 +246,34 @@ mark { } .bloglist { + text-align: left; font-size: 1.5rem; padding: 20px 0; } +.bloglist-item { + display: flex; + justify-content: space-between; + align-items: center; + +} + +.bloglist-item-tag a { + color: gray; + text-decoration: none; + font-size: 0.75em; +} + +.bloglist-item-tag a:hover { + color: #555; +} + +@media (max-width: 850px) { + .bloglist-item-tag { + display: none; + } +} + .bloglist hr.separator { width: 10px; margin: 30px auto; @@ -255,7 +285,7 @@ mark { */ #feedList { text-align: left; - max-width: 800px; + max-width: 1000px; margin-left: auto; margin-right: auto; } @@ -282,10 +312,12 @@ main { } article { - padding-bottom: 20px; + padding-bottom: 2rem; } main .e-content { + padding-top: 2rem; + padding-bottom: 2rem; text-align: left; } @@ -346,7 +378,7 @@ footer a:link { } .footer-navs { - max-width: 800px; + max-width: 1000px; margin-left: auto; margin-right: auto; display: flex; diff --git a/layouts/blog/list.html b/layouts/blog/list.html index ef72395..eece360 100644 --- a/layouts/blog/list.html +++ b/layouts/blog/list.html @@ -28,7 +28,17 @@ {{ end }}

{{ .Key }}

{{ range .Pages }} -

{{ .Title }}

+
+

{{ .Title }}

+

+ {{ range .Params.tags }} + {{ $name := . }} + {{ with $.Site.GetPage (printf "/tags/%s" (. | urlize)) }} + #{{ $name }} + {{ end }} + {{ end }} +

+
{{ end }} {{ end }} diff --git a/layouts/partials/tags/all.html b/layouts/partials/tags/all.html index d2692f7..d01dec0 100644 --- a/layouts/partials/tags/all.html +++ b/layouts/partials/tags/all.html @@ -1,5 +1,5 @@ -
+
Tags
    {{ range .Site.Taxonomies.tags.ByCount }} diff --git a/layouts/partials/tags/page.html b/layouts/partials/tags/page.html index d7929ea..8a6ab81 100644 --- a/layouts/partials/tags/page.html +++ b/layouts/partials/tags/page.html @@ -1,5 +1,5 @@ -
    +
      {{ range .Param "tags" }} {{ $name := . }} diff --git a/layouts/tags/list.html b/layouts/tags/list.html index 0ae7226..b151200 100644 --- a/layouts/tags/list.html +++ b/layouts/tags/list.html @@ -1,14 +1,16 @@ {{ define "main"}} {{ partial "header.html" . }}
      - {{ partial "search.html" . }} - {{ partial "tags/all.html" . }} +
      + Here you'll find {{ len .Pages | lang.NumFmt 0 }} posts + about {{ .Title }} . +
      {{ $listPageDateFormat := .Site.Params.listPageDateFormat | default "January, 2006"}} {{ range $index, $value := .Pages.GroupByDate $listPageDateFormat }} {{ if (ne $index 0) }} -
      +
      {{ end }}

      {{ .Key }}

      {{ range .Pages }} diff --git a/layouts/tags/single.html b/layouts/tags/single.html index e2e659d..038c706 100644 --- a/layouts/tags/single.html +++ b/layouts/tags/single.html @@ -18,7 +18,7 @@
    -
    +
    {{ .Content }}
    {{ partial "footer.html" . }} diff --git a/layouts/tags/terms.html b/layouts/tags/terms.html index 8941263..cca5bb0 100644 --- a/layouts/tags/terms.html +++ b/layouts/tags/terms.html @@ -1,7 +1,26 @@ {{ define "main"}} {{ partial "header.html" . }}
    - {{ partial "tags/all.html" . }} + {{ $posts := where site.RegularPages "Type" "blog" }} + {{ $postCount := len $posts }} + {{ range last 1 $posts }} + {{ $tags := .Site.Taxonomies.tags }} +
    + Here you'll find {{ $postCount | lang.NumFmt 0 }} posts + written spanning {{ len $tags }} topics. +
    + {{ end }} +
    +
    + +
    +
    + {{ .Content }} +
    {{ partial "footer.html" . }} {{ end }}