From 96893d7de6c25f476d369663be9ad9ba37240162 Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Sat, 13 Nov 2021 17:04:10 -0600 Subject: [PATCH] Add better series taxonomy list and clean up post metadata --- assets/css/bobastyle.css | 27 ++++++- layouts/_default/summary.html | 2 +- layouts/partials/authors-meta-item.html | 19 +++++ layouts/partials/post-metadata-short.html | 18 +++++ layouts/partials/post-metadata.html | 77 ++------------------ layouts/partials/readingtime-meta-item.html | 6 ++ layouts/partials/series-meta-item.html | 10 +++ layouts/partials/tags-meta-item.html | 8 ++ layouts/partials/translations-meta-item.html | 8 ++ layouts/partials/viewsource-meta-item.html | 13 ++++ layouts/taxonomy/list.html | 65 +++++++++++++++-- 11 files changed, 172 insertions(+), 81 deletions(-) create mode 100644 layouts/partials/authors-meta-item.html create mode 100644 layouts/partials/post-metadata-short.html create mode 100644 layouts/partials/readingtime-meta-item.html create mode 100644 layouts/partials/series-meta-item.html create mode 100644 layouts/partials/tags-meta-item.html create mode 100644 layouts/partials/translations-meta-item.html create mode 100644 layouts/partials/viewsource-meta-item.html diff --git a/assets/css/bobastyle.css b/assets/css/bobastyle.css index 2cfc0cb..3a500e4 100644 --- a/assets/css/bobastyle.css +++ b/assets/css/bobastyle.css @@ -4,12 +4,14 @@ /* Post layout (in list pages) */ -.page-list ul { +.page-list ul, +.series-taxonomy ul { list-style: none; padding: 0; } -.page-list li { +.page-list li, +.series-taxonomy li { padding-top: 8px; padding-left: 24px; padding-right: 24px; @@ -18,7 +20,8 @@ background-color: #222; } -.page-list li+li { +.page-list li+li, +.series-taxonomy > ul > li+li { margin: 40px 0; } @@ -59,6 +62,24 @@ +/* Series list format */ +.series-pages ul { + display: flex; + gap: 10px; + flex-flow: row wrap; + list-style: none; + padding: 0; + background-color: #111; + padding: 8px; + border-radius: 16px; +} + +.series-pages li { + flex: 1; +} + + + /* Subsection formatting */ .section { margin-bottom: 40px; diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index 9bb7d63..d7617c0 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -5,7 +5,7 @@ {{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }} - {{ partial "post-metadata.html" . }} + {{ partial "post-metadata-short.html" . }} {{ with .Resources.GetMatch "feature" }}
diff --git a/layouts/partials/authors-meta-item.html b/layouts/partials/authors-meta-item.html new file mode 100644 index 0000000..1f90598 --- /dev/null +++ b/layouts/partials/authors-meta-item.html @@ -0,0 +1,19 @@ +{{ with .Params.authors }} + +{{ end }} diff --git a/layouts/partials/post-metadata-short.html b/layouts/partials/post-metadata-short.html new file mode 100644 index 0000000..c208da3 --- /dev/null +++ b/layouts/partials/post-metadata-short.html @@ -0,0 +1,18 @@ +{{ if or .Date .Params.authors .IsTranslated .Site.Params.readingtime }} + +{{ end }} diff --git a/layouts/partials/post-metadata.html b/layouts/partials/post-metadata.html index 3a99a62..e24c67c 100644 --- a/layouts/partials/post-metadata.html +++ b/layouts/partials/post-metadata.html @@ -1,4 +1,4 @@ -{{ if or .Date .IsTranslated .Site.Params.readingtime .Site.Params.repoURL }} +{{ if or .Date .Params.authors .IsTranslated .Site.Params.readingtime .Site.Params.gitFileURL }} {{ end }} diff --git a/layouts/partials/readingtime-meta-item.html b/layouts/partials/readingtime-meta-item.html new file mode 100644 index 0000000..071622c --- /dev/null +++ b/layouts/partials/readingtime-meta-item.html @@ -0,0 +1,6 @@ +{{ if ne .Site.Params.readingtime false }} + +{{ end }} diff --git a/layouts/partials/series-meta-item.html b/layouts/partials/series-meta-item.html new file mode 100644 index 0000000..7ea186b --- /dev/null +++ b/layouts/partials/series-meta-item.html @@ -0,0 +1,10 @@ +{{ with .Params.series }} +
+ {{ range ($.GetTerms "series") }} + + {{ end }} +
+{{ end }} diff --git a/layouts/partials/tags-meta-item.html b/layouts/partials/tags-meta-item.html new file mode 100644 index 0000000..a1ca840 --- /dev/null +++ b/layouts/partials/tags-meta-item.html @@ -0,0 +1,8 @@ +
+ {{ range (.GetTerms "tags") }} + + {{ end }} +
diff --git a/layouts/partials/translations-meta-item.html b/layouts/partials/translations-meta-item.html new file mode 100644 index 0000000..5ac2f38 --- /dev/null +++ b/layouts/partials/translations-meta-item.html @@ -0,0 +1,8 @@ +{{ if .IsTranslated }} + +{{ end }} diff --git a/layouts/partials/viewsource-meta-item.html b/layouts/partials/viewsource-meta-item.html new file mode 100644 index 0000000..baf8a60 --- /dev/null +++ b/layouts/partials/viewsource-meta-item.html @@ -0,0 +1,13 @@ +{{ with .Site.Params.gitFileURL }} + +{{ end }} diff --git a/layouts/taxonomy/list.html b/layouts/taxonomy/list.html index dc2abc6..68d53d7 100644 --- a/layouts/taxonomy/list.html +++ b/layouts/taxonomy/list.html @@ -23,13 +23,64 @@ {{ if eq .Kind "taxonomy" }} - + +{{ if eq .Data.Singular "series" }} +
+
    + {{ range .Pages }} +
  • +
    +

    + {{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }} + {{ .Title | markdownify }} + {{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }} +

    + + + {{ with .Description }} +
    +

    {{ . | markdownify }}

    +
    + {{ end }} + +
    +
      + {{ range .Data.Pages.Reverse }} +
    • {{ .Render "summary" }}
    • + {{ end }} +
    +
    +
    +
  • + {{ end }} +
+
+{{ else }} +
+ +
+{{ end }} {{ else }}