From 8067173f0cd629e74c78010671e7e0df6ee15806 Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Mon, 22 Nov 2021 01:36:29 -0600 Subject: [PATCH] Revamp authors taxonomy Fixes #43 --- i18n/en.yaml | 4 ++++ layouts/_default/author-summary.html | 16 ++++++++++++++++ layouts/authors/list.html | 14 ++++++++++++++ layouts/authors/term.html | 25 +++++++++++++++++++++++++ layouts/partials/author-metadata.html | 22 +++++++++++++++------- layouts/partials/term-description.html | 5 ----- layouts/series/term.html | 2 +- layouts/taxonomy/list.html | 2 -- layouts/taxonomy/term.html | 4 +--- 9 files changed, 76 insertions(+), 18 deletions(-) create mode 100644 layouts/_default/author-summary.html create mode 100644 layouts/authors/list.html create mode 100644 layouts/authors/term.html delete mode 100644 layouts/partials/term-description.html diff --git a/i18n/en.yaml b/i18n/en.yaml index a4cf262..b41fff9 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -23,6 +23,10 @@ browser_no_video_support: no_posts: other: "No posts here!" +post_count: + one: "{{ . }} post" + other: "{{ . }} posts" + table_of_contents: other: "Table of Contents" diff --git a/layouts/_default/author-summary.html b/layouts/_default/author-summary.html new file mode 100644 index 0000000..1eb194b --- /dev/null +++ b/layouts/_default/author-summary.html @@ -0,0 +1,16 @@ +
+

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

+ + {{ partial "author-metadata.html" . }} + +
+ {{ partial "description-or-summary.html" . }} +
+ + +
diff --git a/layouts/authors/list.html b/layouts/authors/list.html new file mode 100644 index 0000000..2b1d50d --- /dev/null +++ b/layouts/authors/list.html @@ -0,0 +1,14 @@ +{{ define "main" }} +

+ {{ partial "icon.html" "user-circle" }} + {{ .Title | markdownify }} +

+ +
+ +
+{{ end }} diff --git a/layouts/authors/term.html b/layouts/authors/term.html new file mode 100644 index 0000000..97e96ef --- /dev/null +++ b/layouts/authors/term.html @@ -0,0 +1,25 @@ +{{ define "main" }} +

+ {{ partial "icon.html" "user-circle" }} + {{ .Title | markdownify }} + {{ partial "rss-link.html" . }} +

+ + {{ partial "author-metadata.html" . }} + + {{ .Content }} + +
+ +
+ + {{ partial "pagination.html" . }} +{{ end }} diff --git a/layouts/partials/author-metadata.html b/layouts/partials/author-metadata.html index 83656cc..64d62dc 100644 --- a/layouts/partials/author-metadata.html +++ b/layouts/partials/author-metadata.html @@ -1,9 +1,17 @@ -{{ with .Params.authors }} +
+ {{/* Calculate the total word count */}} + {{ $total_words := 0 }} + {{ range .Data.Pages }} + {{ $total_words = add $total_words .WordCount }} + {{ end }} - + -{{ range . }} - -{{ end }} - -{{ end }} + +
diff --git a/layouts/partials/term-description.html b/layouts/partials/term-description.html deleted file mode 100644 index a8f9231..0000000 --- a/layouts/partials/term-description.html +++ /dev/null @@ -1,5 +0,0 @@ -{{ with .Description }} -
-

{{ . | markdownify }}

-
-{{ end }} diff --git a/layouts/series/term.html b/layouts/series/term.html index 5ffee0f..b292c1a 100644 --- a/layouts/series/term.html +++ b/layouts/series/term.html @@ -5,7 +5,7 @@ {{ partial "rss-link.html" . }} - {{ partial "term-description.html" . }} + {{ partial "description-or-summary.html" . }}