From 32a0c2f2bf79921236648d47196de6f6e6626c46 Mon Sep 17 00:00:00 2001 From: Jan-Lukas Else Date: Sun, 12 Apr 2020 10:24:35 +0200 Subject: [PATCH] Add option for promo message below article --- assets/css/style.scss | 9 +++++++++ layouts/_default/list.html | 2 +- layouts/_default/single.html | 3 ++- layouts/index.html | 2 +- layouts/partials/authorbox.html | 6 ++---- layouts/partials/promo.html | 3 +++ layouts/photos/list.html | 2 +- 7 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 layouts/partials/promo.html diff --git a/assets/css/style.scss b/assets/css/style.scss index b3243c5..8a99b32 100644 --- a/assets/css/style.scss +++ b/assets/css/style.scss @@ -616,6 +616,15 @@ select { } } +/* Promo */ +.promo { + @include subarticle-element; + font-weight: bold; + a { + text-decoration: underline; + } +} + /* Webmentionform */ .wm-form { @include subarticle-element; diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 325c35e..bef9c37 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -20,7 +20,7 @@ {{- .Render "summary" }} {{- end }} {{- end }} - {{ partialCached "authorbox" . (.Param "authorbox") }} + {{ if (.Param "authorbox") }}{{ partialCached "authorbox" . }}{{ end }} {{ partial "pagination" . }} {{ end }} \ No newline at end of file diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 2e0206c..8f11442 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -28,8 +28,9 @@ {{ partial "post_tags" . }} - {{ partialCached "authorbox" . (.Param "authorbox") }} + {{ if (.Param "authorbox") }}{{ partialCached "authorbox" . }}{{ end }} +{{ if (and (.Param "promo") .CurrentSection.Parent) }}{{ partialCached "promo" . }}{{ end }} {{ range $i, $image := .Params.images }} diff --git a/layouts/index.html b/layouts/index.html index be93b40..321ecd2 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -10,7 +10,7 @@ {{- range $paginator.Pages }} {{- .Render "summary" }} {{- end }} - {{ partialCached "authorbox" . (.Param "authorbox") }} + {{ if (.Param "authorbox") }}{{ partialCached "authorbox" . }}{{ end }} {{ partial "pagination.html" . }} {{ end }} \ No newline at end of file diff --git a/layouts/partials/authorbox.html b/layouts/partials/authorbox.html index e23134b..77e7040 100644 --- a/layouts/partials/authorbox.html +++ b/layouts/partials/authorbox.html @@ -1,5 +1,4 @@ -{{- if .Param "authorbox" }} -{{- with .Site.Author }} +{{ with .Site.Author }}
{{ if .avatar }}
@@ -17,5 +16,4 @@
{{ end }} -{{- end }} -{{- end }} \ No newline at end of file +{{ end }} \ No newline at end of file diff --git a/layouts/partials/promo.html b/layouts/partials/promo.html new file mode 100644 index 0000000..e67073c --- /dev/null +++ b/layouts/partials/promo.html @@ -0,0 +1,3 @@ +
+ {{ (.Site.Params.promo) | emojify | markdownify }} +
\ No newline at end of file diff --git a/layouts/photos/list.html b/layouts/photos/list.html index dab03e4..f4935e0 100644 --- a/layouts/photos/list.html +++ b/layouts/photos/list.html @@ -15,7 +15,7 @@ {{- range $paginator.Pages }} {{- .Render "photosummary" }} {{- end }} - {{ partialCached "authorbox" . (.Param "authorbox") }} + {{ if (.Param "authorbox") }}{{ partialCached "authorbox" . }}{{ end }} {{ partial "pagination" . }} {{ end }} \ No newline at end of file