diff options
author | Jimmy Cai <jimmehcai@gmail.com> | 2020-09-11 19:07:29 +0300 |
---|---|---|
committer | Jimmy Cai <jimmehcai@gmail.com> | 2020-09-11 19:07:29 +0300 |
commit | a2732a312a0ab8e2533eaf9c571d521354690b4b (patch) | |
tree | 784c2f38d68dfee0d569556f18734d2d30250fbe | |
parent | 2acd380e98e705801eb90e8c6dee4395e4381aa8 (diff) |
feat(image): add article and article list default image settings
-rw-r--r-- | exampleSite/config.toml | 8 | ||||
-rw-r--r-- | layouts/_default/term.html | 2 | ||||
-rw-r--r-- | layouts/partials/article-list/compact.html | 2 | ||||
-rw-r--r-- | layouts/partials/article-list/default.html | 2 | ||||
-rw-r--r-- | layouts/partials/article-list/tile.html | 2 | ||||
-rw-r--r-- | 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 }} </div> - {{ $image := partial "helper/image" (dict "Context" .) }} + {{ $image := partial "helper/image" (dict "Context" . "Type" "taxonomy") }} {{ if $image.exists }} <div class="taxonomy-image"> {{ 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 @@ </footer> </div> - {{ $image := partial "helper/image" (dict "Context" .) }} + {{ $image := partial "helper/image" (dict "Context" . "Type" "articleList") }} {{ if $image.exists }} <div class="article-image"> 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") }} <article class="{{ if $image.exists }}has-image{{ end }}"> {{ if $image.exists }} <div class="article-image"> 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) }} <article class="{{ if $image.exists }}has-image{{ end }}"> <a href="{{ .context.Permalink }}"> diff --git a/layouts/partials/article/components/header.html b/layouts/partials/article/components/header.html index 702e923..df7c764 100644 --- a/layouts/partials/article/components/header.html +++ b/layouts/partials/article/components/header.html @@ -1,5 +1,5 @@ <header class="article-header"> - {{ $image := partial "helper/image" (dict "Context" .) }} + {{ $image := partial "helper/image" (dict "Context" . "Type" "article") }} {{ if $image.exists }} <div class="article-image"> |