From 02105f748bfa68b725b4d9c274cd80cc9e759c89 Mon Sep 17 00:00:00 2001 From: Thomas Jensen Date: Sat, 9 Jan 2021 22:58:50 +0100 Subject: [PATCH] move post cover to partial --- layouts/_default/index.html | 12 +----------- layouts/_default/list.html | 12 +----------- layouts/_default/single.html | 12 +----------- layouts/partials/postcover.html | 11 +++++++++++ 4 files changed, 14 insertions(+), 33 deletions(-) create mode 100644 layouts/partials/postcover.html diff --git a/layouts/_default/index.html b/layouts/_default/index.html index 8ee11f9..78131b5 100644 --- a/layouts/_default/index.html +++ b/layouts/_default/index.html @@ -47,17 +47,7 @@ {{ end }} {{ if .Params.Cover }} -
- {{ if .Params.UseRelativeCover }} - {{ .Params.CoverAlt | plainify | default .Title }} - {{ else }} - {{ .Params.CoverAlt | plainify | default .Title }} - {{ end }} - - {{ if .Params.CoverCaption }} -
{{ .Params.CoverCaption | markdownify }}
- {{ end }} -
+ {{ partial "postcover.html" . }} {{ end }}
diff --git a/layouts/_default/list.html b/layouts/_default/list.html index bba91d4..bacfde3 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -35,17 +35,7 @@ {{ end }} {{ if .Params.Cover }} -
- {{ if .Params.UseRelativeCover }} - {{ .Params.CoverAlt | plainify | default .Title }} - {{ else }} - {{ .Params.CoverAlt | plainify | default .Title }} - {{ end }} - - {{ if .Params.CoverCaption }} -
{{ .Params.CoverCaption | markdownify }}
- {{ end }} -
+ {{ partial "postcover.html" . }} {{ end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html index e006ca7..af4561f 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -39,17 +39,7 @@ {{ end }} {{ if .Params.Cover }} -
- {{ if .Params.UseRelativeCover }} - {{ .Params.CoverAlt | plainify | default .Title }} - {{ else }} - {{ .Params.CoverAlt | plainify | default .Title }} - {{ end }} - - {{ if .Params.CoverCaption }} -
{{ .Params.CoverCaption | markdownify }}
- {{ end }} -
+ {{ partial "postcover.html" . }} {{ end }}
diff --git a/layouts/partials/postcover.html b/layouts/partials/postcover.html new file mode 100644 index 0000000..d9e0bc6 --- /dev/null +++ b/layouts/partials/postcover.html @@ -0,0 +1,11 @@ +
+ {{ if .Params.UseRelativeCover }} + {{ .Params.CoverAlt | plainify | default .Title }} + {{ else }} + {{ .Params.CoverAlt | plainify | default .Title }} + {{ end }} + + {{ if .Params.CoverCaption }} +
{{ .Params.CoverCaption | markdownify }}
+ {{ end }} +