From a2732a312a0ab8e2533eaf9c571d521354690b4b Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Fri, 11 Sep 2020 18:07:29 +0200 Subject: [PATCH] feat(image): add article and article list default image settings --- exampleSite/config.toml | 8 ++++++++ layouts/_default/term.html | 2 +- layouts/partials/article-list/compact.html | 2 +- layouts/partials/article-list/default.html | 2 +- layouts/partials/article-list/tile.html | 2 +- layouts/partials/article/components/header.html | 2 +- 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 294742c..496a8ce 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -41,6 +41,14 @@ DefaultContentLanguage = "en" # Theme i18n support [params.opengraph.twitter] site = "" [params.defaultImage] + [params.defaultImage.article] + enabled = false + local = false + src = "" + [params.defaultImage.articleList] + enabled = false + local = true + src = "" [params.defaultImage.opengraph] enabled = false local = false diff --git a/layouts/_default/term.html b/layouts/_default/term.html index b3d2cce..0b63549 100644 --- a/layouts/_default/term.html +++ b/layouts/_default/term.html @@ -15,7 +15,7 @@ {{ end }} - {{ $image := partial "helper/image" (dict "Context" .) }} + {{ $image := partial "helper/image" (dict "Context" . "Type" "taxonomy") }} {{ if $image.exists }}
{{ if $image.resource }} diff --git a/layouts/partials/article-list/compact.html b/layouts/partials/article-list/compact.html index 61c1f29..1a71318 100644 --- a/layouts/partials/article-list/compact.html +++ b/layouts/partials/article-list/compact.html @@ -12,7 +12,7 @@
- {{ $image := partial "helper/image" (dict "Context" .) }} + {{ $image := partial "helper/image" (dict "Context" . "Type" "articleList") }} {{ if $image.exists }}
diff --git a/layouts/partials/article-list/default.html b/layouts/partials/article-list/default.html index 879d848..8c59ff7 100644 --- a/layouts/partials/article-list/default.html +++ b/layouts/partials/article-list/default.html @@ -1,4 +1,4 @@ -{{ $image := partial "helper/image" (dict "Context" .) }} +{{ $image := partial "helper/image" (dict "Context" . "Type" "articleList") }}
{{ if $image.exists }}
diff --git a/layouts/partials/article-list/tile.html b/layouts/partials/article-list/tile.html index 4af3028..ea38a83 100644 --- a/layouts/partials/article-list/tile.html +++ b/layouts/partials/article-list/tile.html @@ -1,4 +1,4 @@ -{{ $image := partial "helper/image" (dict "Context" .context) }} +{{ $image := partial "helper/image" (dict "Context" .context "Type" .Type) }}