From 7d4a696a70969b82a55715221b85700a1e68d140 Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Sun, 5 Jun 2022 18:10:34 +0200 Subject: Rework single post layouts --- layouts/partials/page/single.html | 13 +++++++++++++ layouts/partials/post-class.html | 8 ++++++++ layouts/partials/post-meta.html | 9 --------- 3 files changed, 21 insertions(+), 9 deletions(-) create mode 100644 layouts/partials/page/single.html create mode 100644 layouts/partials/post-class.html delete mode 100644 layouts/partials/post-meta.html (limited to 'layouts/partials') diff --git a/layouts/partials/page/single.html b/layouts/partials/page/single.html new file mode 100644 index 0000000..ca1180d --- /dev/null +++ b/layouts/partials/page/single.html @@ -0,0 +1,13 @@ +{{ define "main" }} +
+
+

+ {{ .Params.caption | default .Title }} +

+
+ +
+ {{ .Content }} +
+
+{{ end }} diff --git a/layouts/partials/post-class.html b/layouts/partials/post-class.html new file mode 100644 index 0000000..1d32a8a --- /dev/null +++ b/layouts/partials/post-class.html @@ -0,0 +1,8 @@ +{{- $postClass := "page" -}} +{{- if .IsPage -}} + {{- $postClass = .Type | lower | singularize -}} + {{- if eq $postClass "poem" -}} + {{- $postClass = "poem poetry" -}} + {{- end -}} +{{- end -}} +{{- $postClass -}} diff --git a/layouts/partials/post-meta.html b/layouts/partials/post-meta.html deleted file mode 100644 index 19c3ce6..0000000 --- a/layouts/partials/post-meta.html +++ /dev/null @@ -1,9 +0,0 @@ -
- {{- $root := . -}} - {{- with .Param "postMeta" -}} - {{- range $field := . -}} - {{- $p := printf "post-meta/%s.html" $field -}} - {{- partial $p $root -}} - {{- end -}} - {{- end -}} -
-- cgit v1.2.3