From 30d4ab59be59f0fd4791341e83b6141a9a28f51a Mon Sep 17 00:00:00 2001 From: Wu-Jung Lee Date: Sun, 3 Nov 2024 14:10:19 -0800 Subject: [PATCH] add page_metadata.html --- layouts/page_metadata.html | 67 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 layouts/page_metadata.html diff --git a/layouts/page_metadata.html b/layouts/page_metadata.html new file mode 100644 index 00000000000..9d5e85ae3e7 --- /dev/null +++ b/layouts/page_metadata.html @@ -0,0 +1,67 @@ +{{ $is_list := .is_list }} +{{ $page := .page }} + +
+ + {{/* If `authors` is set and is not empty. */}} + {{ if $page.Params.authors }} + {{ $authorLen := len $page.Params.authors }} + {{ if gt $authorLen 0 }} +
+ {{ partial "page_metadata_authors" $page }} +
+ {{ end }} + {{ end }} + + {{ if not (in (slice "talk" "page" "portfolio") $page.Type) }} + + {{ end }} + + {{ if and (eq $is_list 1) (eq $page.Type "publication") }} + + + {{ if $page.Params.publication_short }} + {{ $page.Params.publication_short | markdownify }} + {{ else if $page.Params.publication }} + {{ $page.Params.publication | markdownify }} + {{ end }} + + {{ end }} + + {{ if and (eq $page.Type "post") (not (or (eq site.Params.reading_time false) (eq $page.Params.reading_time false))) }} + + + {{ $page.ReadingTime }} {{ i18n "minute_read" }} + + {{ end }} + + {{/* Show Disqus comment count if enabled. */}} + {{ $disqus_enabled := eq site.Params.comments.engine 1 | and (index site.Params.comments.commentable $page.Type) | and (ne $page.Params.commentable false) | or $page.Params.commentable }} + {{ if and $disqus_enabled (site.Params.comments.disqus.show_count | default true) }} + + + {{ end}} + + {{ $taxonomy := "categories" }} + {{ if $page.Param $taxonomy }} + + + + {{- range $index, $value := ($page.GetTerms $taxonomy) -}} + {{- if gt $index 0 }}, {{ end -}} + {{ .LinkTitle }} + {{- end -}} + + {{ end }} + +