Fix the single template to use the authors avatar correctly

This commit is contained in:
as027811 2020-10-18 21:36:39 -04:00 committed by Emruz Hossain
parent 47c4ef0251
commit dda04c533e
4 changed files with 18 additions and 13 deletions

View file

@ -98,9 +98,9 @@ params:
# transparent navbar and the main logo will be used in the non-transparent navbar. # transparent navbar and the main logo will be used in the non-transparent navbar.
# It will be default to the theme logos if not provided. # It will be default to the theme logos if not provided.
logo: logo:
main: assets/images/main-logo.png main: /assets/images/main-logo.png
inverted: assets/images/inverted-logo.png inverted: /assets/images/inverted-logo.png
favicon: assets/images/favicon.png favicon: /assets/images/favicon.png
# GitHub repo URL of your site # GitHub repo URL of your site
gitRepo: https://github.com/hossainemruz/toha-example-site gitRepo: https://github.com/hossainemruz/toha-example-site

View file

@ -15,7 +15,7 @@ languages:
bn: bn:
languageName: বাংলা languageName: বাংলা
weight: 3 weight: 3
de: de:
languageName: Deutsch languageName: Deutsch
weight: 4 weight: 4
id: id:
@ -54,9 +54,9 @@ params:
# transparent navbar and the main logo will be used in the non-transparent navbar. # transparent navbar and the main logo will be used in the non-transparent navbar.
# It will be default to the theme logos if not provided. # It will be default to the theme logos if not provided.
logo: logo:
main: assets/images/main-logo.png main: /assets/images/main-logo.png
inverted: assets/images/inverted-logo.png inverted: /assets/images/inverted-logo.png
favicon: assets/images/favicon.png favicon: /assets/images/favicon.png
# GitHub repo URL of your site # GitHub repo URL of your site
gitRepo: https://github.com/hossainemruz/toha-example-site gitRepo: https://github.com/hossainemruz/toha-example-site

View file

@ -1,7 +1,12 @@
{{ $authorImage:= "/assets/images/default-avatar.png"}} {{ $author:= .Site.Data.author }}
{{ if .Site.Data.site.author}} {{ if (index .Site.Data .Site.Language.Lang).author }}
{{ $authorImage = .Site.Data.site.author.image | relURL }} {{ $author = (index .Site.Data .Site.Language.Lang).author }}
{{ end}} {{ end }}
{{ $authorImage:= "/assets/images/default-avatar.png" }}
{{ if $author.image }}
{{ $authorImage = $author.image }}
{{ end }}
{{ if eq (printf "%T" .Params.author ) "maps.Params" }} {{ if eq (printf "%T" .Params.author ) "maps.Params" }}
{{ with .Params.author }} {{ with .Params.author }}
{{ if .image }} {{ if .image }}

View file

@ -15,12 +15,12 @@
{{ $sections = (index .Site.Data .Site.Language.Lang).sections }} {{ $sections = (index .Site.Data .Site.Language.Lang).sections }}
{{ end }} {{ end }}
{{ $backgroundImage:= "assets/images/default-background.jpg" }} {{ $backgroundImage:= "/assets/images/default-background.jpg" }}
{{ if .Site.Params.background }} {{ if .Site.Params.background }}
{{ $backgroundImage = .Site.Params.background }} {{ $backgroundImage = .Site.Params.background }}
{{ end }} {{ end }}
{{ $authorImage:= "assets/images/default-avatar.png" }} {{ $authorImage:= "/assets/images/default-avatar.png" }}
{{ if $author.image }} {{ if $author.image }}
{{ $authorImage = $author.image }} {{ $authorImage = $author.image }}
{{ end }} {{ end }}