From 9f8f86dbc036d9ae802622b46caf6d530aacd1ca Mon Sep 17 00:00:00 2001 From: Jan-Lukas Else Date: Tue, 19 Nov 2019 09:22:33 +0100 Subject: [PATCH] Improve display of posts with no title --- assets/css/style.scss | 2 +- layouts/_default/baseof.html | 2 +- layouts/_default/single.html | 8 +++++--- layouts/_default/summary.html | 14 ++++++-------- layouts/links/single.html | 8 +++++--- layouts/links/summary.html | 2 ++ 6 files changed, 20 insertions(+), 16 deletions(-) diff --git a/assets/css/style.scss b/assets/css/style.scss index dd015d8..1608070 100644 --- a/assets/css/style.scss +++ b/assets/css/style.scss @@ -489,11 +489,11 @@ select { } .post-title { margin: 0; + margin-bottom: 10px; } .post-meta { @extend .meta; padding: 5px 0; - margin-top: 10px; @include color-border(border-top, 1px, dotted, border); @include color-border(border-bottom, 1px, dotted, border); } diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 7e72ac3..f0559b3 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -4,7 +4,7 @@ - {{ block "title" . }}{{ if not .IsHome }}{{ .Title }} - {{ end }}{{ .Site.Title }}{{ end }} + {{ block "title" . }}{{ if not .IsHome }}{{ with .Title }}{{ . }} - {{end}}{{ end }}{{ .Site.Title }}{{ end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 3950794..c9ae908 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -2,10 +2,12 @@
-

{{ .Title }}

- {{ with partial "post_meta.html" . -}} + {{ with .Title }} +

{{ . }}

+ {{ end }} + {{ with partial "post_meta.html" . }} - {{- end }} + {{ end }}
{{ with .Params.audio }} diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index 7d54a60..36c9efd 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -1,20 +1,18 @@ \ No newline at end of file diff --git a/layouts/links/single.html b/layouts/links/single.html index 9da59aa..c3a7e49 100644 --- a/layouts/links/single.html +++ b/layouts/links/single.html @@ -2,10 +2,12 @@
-

{{ .Title }}

- {{ with partial "post_meta.html" . -}} + {{ with .Title }} +

{{ . }}

+ {{ end }} + {{ with partial "post_meta.html" . }} - {{- end }} + {{ end }}
{{ .Content }} diff --git a/layouts/links/summary.html b/layouts/links/summary.html index 05e7c4a..ada91a9 100644 --- a/layouts/links/summary.html +++ b/layouts/links/summary.html @@ -1,8 +1,10 @@
+ {{ if .Title }}

{{ .Title }}

+ {{ end }} {{ with partial "post_meta.html" . -}}
{{ . }}
{{- end }}