Revamp authors taxonomy

Fixes #43
This commit is contained in:
BBaoVanC 2021-11-22 01:36:29 -06:00
parent b745f87462
commit 8067173f0c
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A
9 changed files with 76 additions and 18 deletions

View File

@ -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"

View File

@ -0,0 +1,16 @@
<div class="post">
<h2 class="post-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h2>
{{ partial "author-metadata.html" . }}
<div class="post-description">
{{ partial "description-or-summary.html" . }}
</div>
<div class="readmore">
<a href="{{ .Permalink }}">{{ i18n "read_more" }} &rarr;</a>
</div>
</div>

14
layouts/authors/list.html Normal file
View File

@ -0,0 +1,14 @@
{{ define "main" }}
<h1>
{{ partial "icon.html" "user-circle" }}
{{ .Title | markdownify }}
</h1>
<div class="page-list">
<ul>
{{ range .Paginator.Pages }}
<li>{{ .Render "author-summary" }}</li>
{{ end }}
</ul>
</div>
{{ end }}

25
layouts/authors/term.html Normal file
View File

@ -0,0 +1,25 @@
{{ define "main" }}
<h1>
{{ partial "icon.html" "user-circle" }}
{{ .Title | markdownify }}
{{ partial "rss-link.html" . }}
</h1>
{{ partial "author-metadata.html" . }}
{{ .Content }}
<div class="page-list">
<ul>
{{ range .Paginator.Pages }}
<li>{{ .Render "summary" }}</li>
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ end }}
</ul>
</div>
{{ partial "pagination.html" . }}
{{ end }}

View File

@ -1,9 +1,17 @@
{{ with .Params.authors }}
<div class="post-metadata">
{{/* Calculate the total word count */}}
{{ $total_words := 0 }}
{{ range .Data.Pages }}
{{ $total_words = add $total_words .WordCount }}
{{ end }}
<meta name="author" content="{{ delimit . ", " }}">
<span class="post-meta-item">
{{ partial "icon.html" "newspaper" }}
{{ i18n "post_count" (len .Data.Pages) }}
</span>
{{ range . }}
<meta property="article:author" content="{{ . }}">
{{ end }}
{{ end }}
<span class="post-meta-item">
{{ partial "icon.html" "align-left" }}
{{ i18n "wordcount" $total_words }}
</span>
</div>

View File

@ -1,5 +0,0 @@
{{ with .Description }}
<div class="term-description">
<p>{{ . | markdownify }}</p>
</div>
{{ end }}

View File

@ -5,7 +5,7 @@
{{ partial "rss-link.html" . }}
</h1>
{{ partial "term-description.html" . }}
{{ partial "description-or-summary.html" . }}
<div class="page-list">
<ul>

View File

@ -2,8 +2,6 @@
<h1>
{{ if eq .Data.Singular "tag" }}
{{ partial "icon.html" "tag" }}
{{ else if eq .Data.Singular "author" }}
{{ partial "icon.html" "user-circle" }}
{{ else }}
{{ partial "icon.html" "filter" }}
{{ end }}

View File

@ -2,8 +2,6 @@
<h1>
{{ if eq .Data.Singular "tag" }}
{{ partial "icon.html" "tag" }}
{{ else if eq .Data.Singular "author" }}
{{ partial "icon.html" "user-circle" }}
{{ else }}
{{ partial "icon.html" "filter" }}
{{ end }}
@ -12,7 +10,7 @@
{{ partial "rss-link.html" . }}
</h1>
{{ partial "term-description.html" . }}
{{ partial "description-or-summary.html" . }}
<div class="page-list">
<ul>
{{ range .Paginator.Pages }}