feat(image): add article and article list default image settings

This commit is contained in:
Jimmy Cai 2020-09-11 18:07:29 +02:00
parent 2acd380e98
commit a2732a312a
No known key found for this signature in database
GPG Key ID: 3EA408E527F37B18
6 changed files with 13 additions and 5 deletions

View File

@ -41,6 +41,14 @@ DefaultContentLanguage = "en" # Theme i18n support
[params.opengraph.twitter] [params.opengraph.twitter]
site = "" site = ""
[params.defaultImage] [params.defaultImage]
[params.defaultImage.article]
enabled = false
local = false
src = ""
[params.defaultImage.articleList]
enabled = false
local = true
src = ""
[params.defaultImage.opengraph] [params.defaultImage.opengraph]
enabled = false enabled = false
local = false local = false

View File

@ -15,7 +15,7 @@
{{ end }} {{ end }}
</div> </div>
{{ $image := partial "helper/image" (dict "Context" .) }} {{ $image := partial "helper/image" (dict "Context" . "Type" "taxonomy") }}
{{ if $image.exists }} {{ if $image.exists }}
<div class="taxonomy-image"> <div class="taxonomy-image">
{{ if $image.resource }} {{ if $image.resource }}

View File

@ -12,7 +12,7 @@
</footer> </footer>
</div> </div>
{{ $image := partial "helper/image" (dict "Context" .) }} {{ $image := partial "helper/image" (dict "Context" . "Type" "articleList") }}
{{ if $image.exists }} {{ if $image.exists }}
<div class="article-image"> <div class="article-image">

View File

@ -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 }}"> <article class="{{ if $image.exists }}has-image{{ end }}">
{{ if $image.exists }} {{ if $image.exists }}
<div class="article-image"> <div class="article-image">

View File

@ -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 }}"> <article class="{{ if $image.exists }}has-image{{ end }}">
<a href="{{ .context.Permalink }}"> <a href="{{ .context.Permalink }}">

View File

@ -1,5 +1,5 @@
<header class="article-header"> <header class="article-header">
{{ $image := partial "helper/image" (dict "Context" .) }} {{ $image := partial "helper/image" (dict "Context" . "Type" "article") }}
{{ if $image.exists }} {{ if $image.exists }}
<div class="article-image"> <div class="article-image">