summaryrefslogtreecommitdiffstats
path: root/layouts/partials
diff options
context:
space:
mode:
authorSerghei Iakovlev <egrep@protonmail.ch>2022-06-05 18:10:34 +0200
committerSerghei Iakovlev <egrep@protonmail.ch>2022-06-05 18:10:42 +0200
commit7d4a696a70969b82a55715221b85700a1e68d140 (patch)
treef80a870391737b9afa1090f3f37975e95fbd1dd2 /layouts/partials
parent0c30ea398b6315e9b99afa4067a4897fad876d60 (diff)
downloadgohugo-theme-ed-7d4a696a70969b82a55715221b85700a1e68d140.tar.gz
Rework single post layouts
Diffstat (limited to 'layouts/partials')
-rw-r--r--layouts/partials/page/single.html13
-rw-r--r--layouts/partials/post-class.html8
-rw-r--r--layouts/partials/post-meta.html9
3 files changed, 21 insertions, 9 deletions
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" }}
+<article class="{{ partial "post-class.html" . }}" role="document" id="page-{{ .File.TranslationBaseName | lower }}"{{ with .Params.lang}} lang="{{ . }}"{{ end }}>
+ <header>
+ <h1 class="page-title">
+ {{ .Params.caption | default .Title }}
+ </h1>
+ </header>
+
+ <div class="page-body">
+ {{ .Content }}
+ </div>
+</article>
+{{ 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 @@
-<div class="post-meta">
- {{- $root := . -}}
- {{- with .Param "postMeta" -}}
- {{- range $field := . -}}
- {{- $p := printf "post-meta/%s.html" $field -}}
- {{- partial $p $root -}}
- {{- end -}}
- {{- end -}}
-</div>