From 3770fa6cd0caba7647b89b4763242f9c3c47ef6d Mon Sep 17 00:00:00 2001 From: razonyang Date: Wed, 27 Mar 2024 20:54:39 +0800 Subject: [PATCH] feat: add the meta* page parameters --- layouts/docs/single.html | 8 ++++--- .../partials/hb/modules/docs/doc/meta.html | 21 +++++++++++++------ 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/layouts/docs/single.html b/layouts/docs/single.html index f4d075a3..9722f84f 100644 --- a/layouts/docs/single.html +++ b/layouts/docs/single.html @@ -8,9 +8,11 @@

{{ .Title }}

- + {{- if ne (default dict .Params.meta) false }} + + {{- end }} {{- with .Description }}

{{ . }}

{{- end }} diff --git a/layouts/partials/hb/modules/docs/doc/meta.html b/layouts/partials/hb/modules/docs/doc/meta.html index b2455769..14c86a66 100644 --- a/layouts/partials/hb/modules/docs/doc/meta.html +++ b/layouts/partials/hb/modules/docs/doc/meta.html @@ -1,6 +1,15 @@ -{{ partialCached "hb/modules/blog/post/meta/authors" . . }} - - {{- .Date | time.Format site.Params.hb.docs.date_format -}} - -{{ partialCached "hb/modules/blog/post/meta/reading-time" . . }} -{{ partialCached "hb/modules/blog/post/meta/taxonomies" . . }} +{{- $params := default dict .Params.meta }} +{{- if ne (default true $params.authors) false }} + {{ partialCached "hb/modules/blog/post/meta/authors" . . }} +{{- end }} +{{- if ne (default true $params.date) false }} + + {{- .Date | time.Format site.Params.hb.docs.date_format -}} + +{{- end }} +{{- if ne (default true $params.reading_time) false }} + {{ partialCached "hb/modules/blog/post/meta/reading-time" . . }} +{{- end }} +{{- if ne (default true $params.taxonomies) false }} + {{ partialCached "hb/modules/blog/post/meta/taxonomies" . . }} +{{- end }}