Fix the single template to use the authors avatar correctly (#107)

* Fix the single template to use the authors avatar correctly

* Replace absURL with relURL and .Site.X with site.X

Co-authored-by: Emruz Hossain <emruz@appscode.com>
This commit is contained in:
alex bezek 2020-10-24 22:07:18 -04:00 committed by GitHub
parent 4d19b2f8d1
commit d0c32c5d08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 86 additions and 80 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

@ -3,7 +3,7 @@
{{ end }} {{ end }}
{{ define "navbar" }} {{ define "navbar" }}
{{ partial "navigators/navbar-2.html" (dict "baseURL" .Site.BaseURL "title" .Site.Title "hasToggleButton" false) }} {{ partial "navigators/navbar-2.html" (dict "baseURL" site.BaseURL "title" site.Title "hasToggleButton" false) }}
{{ end }} {{ end }}
{{ define "content" }} {{ define "content" }}

View file

@ -9,7 +9,7 @@
{{ block "header" . }} {{ end }} {{ block "header" . }} {{ end }}
<!-- ADD GOOGLE ANALYTICS IF ENABLED --> <!-- ADD GOOGLE ANALYTICS IF ENABLED -->
{{ if .Site.GoogleAnalytics }} {{ if site.GoogleAnalytics }}
{{ template "_internal/google_analytics_async.html" . }} {{ template "_internal/google_analytics_async.html" . }}
{{ end }} {{ end }}
</head> </head>

View file

@ -21,7 +21,7 @@
<ul class="tree" id="tree"> <ul class="tree" id="tree">
<li id="list-heading"><a href="{{ site.BaseURL | absLangURL }}posts" data-filter="all">Posts</a></li> <li id="list-heading"><a href="{{ site.BaseURL | absLangURL }}posts" data-filter="all">Posts</a></li>
<div class="subtree"> <div class="subtree">
{{ partial "navigators/sidebar.html" (dict "menus" .Site.Menus.sidebar "ctx" .) }} {{ partial "navigators/sidebar.html" (dict "menus" site.Menus.sidebar "ctx" .) }}
</div> </div>
</ul> </ul>
</div> </div>

View file

@ -21,7 +21,7 @@
<ul class="tree" id="tree"> <ul class="tree" id="tree">
<li id="list-heading"><a href="{{ site.BaseURL | absLangURL }}posts" data-filter="all">Posts</a></li> <li id="list-heading"><a href="{{ site.BaseURL | absLangURL }}posts" data-filter="all">Posts</a></li>
<div class="subtree"> <div class="subtree">
{{ partial "navigators/sidebar.html" (dict "menus" .Site.Menus.sidebar "ctx" .) }} {{ partial "navigators/sidebar.html" (dict "menus" site.Menus.sidebar "ctx" .) }}
</div> </div>
</ul> </ul>
</div> </div>
@ -35,13 +35,13 @@
<div class="content"> <div class="content">
<div class="container p-0 read-area"> <div class="container p-0 read-area">
<!--Hero Area--> <!--Hero Area-->
<div class="hero-area col-sm-12" id="hero-area" style='background-image: url({{ strings.TrimSuffix "/" .Site.BaseURL }}{{ partial "helpers/get-hero.html" . }});'> <div class="hero-area col-sm-12" id="hero-area" style='background-image: url({{ strings.TrimSuffix "/" site.BaseURL }}{{ partial "helpers/get-hero.html" . | relURL }});'>
</div> </div>
<!--Content Start--> <!--Content Start-->
<div class="page-content"> <div class="page-content">
<div class="author-profile ml-auto align-self-lg-center"> <div class="author-profile ml-auto align-self-lg-center">
<img class="rounded-circle" src='{{ partial "helpers/get-author-image.html" . }}'/> <img class="rounded-circle" src='{{ partial "helpers/get-author-image.html" . | relURL }}'/>
<h5 class="author-name">{{ partial "helpers/get-author-name.html" . }}</h5> <h5 class="author-name">{{ partial "helpers/get-author-name.html" . }}</h5>
<p>{{ .Page.Date.Format "January 2, 2006" }}</p> <p>{{ .Page.Date.Format "January 2, 2006" }}</p>
</div> </div>
@ -55,9 +55,9 @@
</div> </div>
<!--- Improve this page button ---> <!--- Improve this page button --->
{{ if .Site.Params.GitRepo }} {{ if site.Params.GitRepo }}
<div class="btn-improve-page"> <div class="btn-improve-page">
<a href="{{ .Site.Params.GitRepo }}/edit/master/content/{{ .File.Path }}"> <a href="{{ site.Params.GitRepo }}/edit/master/content/{{ .File.Path }}">
<i class="fas fa-code-branch"></i> <i class="fas fa-code-branch"></i>
Improve This Page Improve This Page
</a> </a>
@ -69,7 +69,7 @@
{{ partial "navigators/next-prev-navigator.html" . }} {{ partial "navigators/next-prev-navigator.html" . }}
<hr /> <hr />
<!-- Add Disqus forum --> <!-- Add Disqus forum -->
{{ if .Site.DisqusShortname }} {{ if site.DisqusShortname }}
{{ partial "disqus.html" . }} {{ partial "disqus.html" . }}
{{ end }} {{ end }}
</div> </div>

View file

@ -10,6 +10,7 @@
{{ end }} {{ end }}
{{ end }} {{ end }}
<meta name="description" content="{{ $siteDescription }}" /> <meta name="description" content="{{ $siteDescription }}" />
<!-- import common headers --> <!-- import common headers -->
{{- partial "header.html" . -}} {{- partial "header.html" . -}}
@ -23,7 +24,7 @@
<link rel="stylesheet" href="{{ "/assets/css/sections/achievements.css" | relURL }}"/> <link rel="stylesheet" href="{{ "/assets/css/sections/achievements.css" | relURL }}"/>
<!-- Add Google Analytics if enabled in configuration --> <!-- Add Google Analytics if enabled in configuration -->
{{ if .Site.GoogleAnalytics }} {{ if site.GoogleAnalytics }}
{{ template "_internal/google_analytics_async.html" . }} {{ template "_internal/google_analytics_async.html" . }}
{{ end }} {{ end }}
</head> </head>
@ -36,9 +37,9 @@
{{- partial "sections/home.html" . -}} {{- partial "sections/home.html" . -}}
<!--- ADD OPTIONAL SECTIONS -----------> <!--- ADD OPTIONAL SECTIONS ----------->
{{ $sections:= .Site.Data.sections }} {{ $sections:= site.Data.sections }}
{{ if (index .Site.Data .Site.Language.Lang).sections }} {{ if (index site.Data site.Language.Lang).sections }}
{{ $sections = (index .Site.Data .Site.Language.Lang).sections }} {{ $sections = (index site.Data site.Language.Lang).sections }}
{{ end }} {{ end }}
{{ if $sections }} {{ if $sections }}

View file

@ -8,7 +8,7 @@
<div> <div>
<div class="d-flex"> <div class="d-flex">
{{ if .logo }} {{ if .logo }}
<img class="card-img-xs" src="{{ .logo | absURL }}" alt="{{ .name }}" /> <img class="card-img-xs" src="{{ .logo | relURL }}" alt="{{ .name }}" />
{{ end }} {{ end }}
<h5 class="card-title mb-0">{{ .name }}</h5> <h5 class="card-title mb-0">{{ .name }}</h5>
</div> </div>

View file

@ -3,7 +3,7 @@
<div class="card"> <div class="card">
<div class="card-head d-flex"> <div class="card-head d-flex">
{{ if .icon }} {{ if .icon }}
<img class="card-img-xs" src="{{ .icon | absURL }}" alt="{{ .name }}" /> <img class="card-img-xs" src="{{ .icon | relURL }}" alt="{{ .name }}" />
{{ end }} {{ end }}
<h5 class="card-title">{{ .name }}</h5> <h5 class="card-title">{{ .name }}</h5>
</div> </div>

View file

@ -8,7 +8,7 @@
var dsq = document.createElement("script"); var dsq = document.createElement("script");
dsq.type = "text/javascript"; dsq.type = "text/javascript";
dsq.async = true; dsq.async = true;
var disqus_shortname = "{{ .Site.DisqusShortname }}"; var disqus_shortname = "{{ site.DisqusShortname }}";
dsq.src = "//" + disqus_shortname + ".disqus.com/embed.js"; dsq.src = "//" + disqus_shortname + ".disqus.com/embed.js";
( (
document.getElementsByTagName("head")[0] || document.getElementsByTagName("head")[0] ||

View file

@ -1,16 +1,16 @@
{{ $author:= .Site.Data.author }} {{ $author:= site.Data.author }}
{{ if (index .Site.Data .Site.Language.Lang).author }} {{ if (index site.Data site.Language.Lang).author }}
{{ $author = (index .Site.Data .Site.Language.Lang).author }} {{ $author = (index site.Data site.Language.Lang).author }}
{{ end }} {{ end }}
{{ $sections:= .Site.Data.sections }} {{ $sections:= site.Data.sections }}
{{ if (index .Site.Data .Site.Language.Lang).sections }} {{ if (index site.Data site.Language.Lang).sections }}
{{ $sections = (index .Site.Data .Site.Language.Lang).sections }} {{ $sections = (index site.Data site.Language.Lang).sections }}
{{ end }} {{ end }}
{{ $copyrightNotice := "© 2020 Copyright."}} {{ $copyrightNotice := "© 2020 Copyright."}}
{{ if (index .Site.Data .Site.Language.Lang).site }} {{ if (index site.Data site.Language.Lang).site }}
{{ $siteConfig := (index .Site.Data .Site.Language.Lang).site }} {{ $siteConfig := (index site.Data site.Language.Lang).site }}
{{ if $siteConfig.copyright }} {{ if $siteConfig.copyright }}
{{ $copyrightNotice = $siteConfig.copyright }} {{ $copyrightNotice = $siteConfig.copyright }}
{{ end }} {{ end }}
@ -48,7 +48,7 @@
</ul> </ul>
</div> </div>
{{ end }} {{ end }}
{{ if .Site.Params.newsletter.enable }} {{ if site.Params.newsletter.enable }}
<div class="col-md-4 col-sm-12"> <div class="col-md-4 col-sm-12">
<!-- <h5>Newsletter</h5> --> <!-- <h5>Newsletter</h5> -->
<p>{{ i18n "newsletter_text" }}</p> <p>{{ i18n "newsletter_text" }}</p>

View file

@ -13,7 +13,7 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.min.css" />
<!--================= fab-icon =========================--> <!--================= fab-icon =========================-->
<link rel="icon" type="image/png" href="{{ .Site.Params.logo.favicon | default "/assets/images/favicon.png" | absURL }}" /> <link rel="icon" type="image/png" href="{{ site.Params.logo.favicon | default "/assets/images/favicon.png" | relURL }}" />
<!--================= custom style overrides =========================--> <!--================= custom style overrides =========================-->
<link rel="stylesheet" href="{{ "/assets/css/style.css" | relURL }}"/> <link rel="stylesheet" href="{{ "/assets/css/style.css" | relURL }}"/>

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

@ -1,6 +1,6 @@
{{ $authorName:= .Site.Params.author.name }} {{ $authorName:= site.Params.author.name }}
{{ if .Site.Data.site.author}} {{ if site.Data.site.author}}
{{ $authorName = .Site.Data.site.author.name }} {{ $authorName = site.Data.site.author.name }}
{{ end}} {{ end}}
{{ if eq (printf "%T" .Params.author ) "maps.Params" }} {{ if eq (printf "%T" .Params.author ) "maps.Params" }}
{{ with .Params.author }} {{ with .Params.author }}

View file

@ -1,12 +1,12 @@
{{ $pageURL:= .RelPermalink }} {{ $pageURL:= .RelPermalink }}
{{ if .Site.IsMultiLingual }} {{ if site.IsMultiLingual }}
{{ $pageURL = strings.TrimPrefix (path.Join "/" .Language.Lang) $pageURL }} {{ $pageURL = strings.TrimPrefix (path.Join "/" .Language.Lang) $pageURL }}
{{ end }} {{ end }}
<div class="dropdown languageSelector"> <div class="dropdown languageSelector">
<a class="btn dropdown-toggle" href="#" id="languageSelector" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <a class="btn dropdown-toggle" href="#" id="languageSelector" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<img class="flag" src="https://www.countryflags.io/{{ partial "helpers/country-code.html" .Language }}/flat/16.png"> <img class="flag" src="https://www.countryflags.io/{{ partial "helpers/country-code.html" .Language }}/flat/16.png">
{{ .Site.Language.LanguageName }} {{ site.Language.LanguageName }}
</a> </a>
<div class="dropdown-menu" aria-labelledby="languageSelector"> <div class="dropdown-menu" aria-labelledby="languageSelector">
{{ range .Translations }} {{ range .Translations }}

View file

@ -1,12 +1,12 @@
{{ $pageURL:= .RelPermalink }} {{ $pageURL:= .RelPermalink }}
{{ if .Site.IsMultiLingual }} {{ if site.IsMultiLingual }}
{{ $pageURL = strings.TrimPrefix (path.Join "/" .Language.Lang) $pageURL }} {{ $pageURL = strings.TrimPrefix (path.Join "/" .Language.Lang) $pageURL }}
{{ end }} {{ end }}
<li class="nav-item dropdown"> <li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="languageSelector" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <a class="nav-link dropdown-toggle" href="#" id="languageSelector" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<img class="flag" src="https://www.countryflags.io/{{ partial "helpers/country-code.html" .Language }}/flat/16.png"> <img class="flag" src="https://www.countryflags.io/{{ partial "helpers/country-code.html" .Language }}/flat/16.png">
{{ .Site.Language.LanguageName }} {{ site.Language.LanguageName }}
</a> </a>
<div class="dropdown-menu" aria-labelledby="languageSelector"> <div class="dropdown-menu" aria-labelledby="languageSelector">
{{ range .Translations }} {{ range .Translations }}

View file

@ -1,10 +1,10 @@
<li class="nav-item dropdown"> <li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="languageSelector" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <a class="nav-link dropdown-toggle" href="#" id="languageSelector" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<img class="flag" src="https://www.countryflags.io/{{ partial "helpers/country-code.html" .Language }}/flat/16.png"> <img class="flag" src="https://www.countryflags.io/{{ partial "helpers/country-code.html" .Language }}/flat/16.png">
{{ .Site.Language.LanguageName }} {{ site.Language.LanguageName }}
</a> </a>
<div class="dropdown-menu" aria-labelledby="languageSelector"> <div class="dropdown-menu" aria-labelledby="languageSelector">
{{ range $.Site.Home.AllTranslations }} {{ range site.Home.AllTranslations }}
<a class="dropdown-item nav-link languages-item" href="{{ .Permalink }}"> <a class="dropdown-item nav-link languages-item" href="{{ .Permalink }}">
<img class="flag" src="https://www.countryflags.io/{{ partial "helpers/country-code.html" .Language }}/flat/24.png"> <img class="flag" src="https://www.countryflags.io/{{ partial "helpers/country-code.html" .Language }}/flat/24.png">
{{ .Language.LanguageName }} {{ .Language.LanguageName }}

View file

@ -1,5 +1,5 @@
{{ $mainLogo:="assets/images/main-logo.png" }} {{ $mainLogo:="/assets/images/main-logo.png" }}
{{ $invertedLogo:="assets/images/inverted-logo.png" }} {{ $invertedLogo:="/assets/images/inverted-logo.png" }}
{{ if site.Params.logo.main }} {{ if site.Params.logo.main }}
{{ $mainLogo = site.Params.logo.main }} {{ $mainLogo = site.Params.logo.main }}
{{ end }} {{ end }}
@ -13,7 +13,7 @@
<span class="navbar-toggler-icon"></span> <span class="navbar-toggler-icon"></span>
</button> </button>
<a class="navbar-brand" href="{{ site.BaseURL | relLangURL }}"> <a class="navbar-brand" href="{{ site.BaseURL | relLangURL }}">
<img src="{{ $mainLogo | absURL }}"> <img src="{{ $mainLogo | relURL }}">
{{- site.Title -}} {{- site.Title -}}
</a> </a>
<button class="navbar-toggler navbar-light" id="toc-toggler" type="button" onclick="toggleTOC()"> <button class="navbar-toggler navbar-light" id="toc-toggler" type="button" onclick="toggleTOC()">
@ -29,6 +29,6 @@
</div> </div>
</div> </div>
<!-- Store the logo information in a hidden img for the JS --> <!-- Store the logo information in a hidden img for the JS -->
<img src="{{ $mainLogo | absURL }}" class="d-none" id="main-logo"> <img src="{{ $mainLogo | relURL }}" class="d-none" id="main-logo">
<img src="{{ $invertedLogo | absURL }}" class="d-none" id="inverted-logo"> <img src="{{ $invertedLogo | relURL }}" class="d-none" id="inverted-logo">
</nav> </nav>

View file

@ -1,22 +1,22 @@
{{ $mainLogo:="assets/images/main-logo.png" }} {{ $mainLogo:="/assets/images/main-logo.png" }}
{{ $invertedLogo:="assets/images/inverted-logo.png" }} {{ $invertedLogo:="/assets/images/inverted-logo.png" }}
{{ if .Site.Params.logo.main }} {{ if site.Params.logo.main }}
{{ $mainLogo = .Site.Params.logo.main }} {{ $mainLogo = site.Params.logo.main }}
{{ end }} {{ end }}
{{ if .Site.Params.logo.inverted }} {{ if site.Params.logo.inverted }}
{{ $invertedLogo = .Site.Params.logo.inverted }} {{ $invertedLogo = site.Params.logo.inverted }}
{{ end }} {{ end }}
{{ $sections:= .Site.Data.sections }} {{ $sections:= site.Data.sections }}
{{ if (index .Site.Data .Site.Language.Lang).sections }} {{ if (index site.Data site.Language.Lang).sections }}
{{ $sections = (index .Site.Data .Site.Language.Lang).sections }} {{ $sections = (index site.Data site.Language.Lang).sections }}
{{ end }} {{ end }}
<nav class="navbar navbar-expand-xl top-navbar initial-navbar" id="top-navbar"> <nav class="navbar navbar-expand-xl top-navbar initial-navbar" id="top-navbar">
<div class="container"> <div class="container">
<a class="navbar-brand" href="{{ .Site.BaseURL | relLangURL }}"> <a class="navbar-brand" href="{{ site.BaseURL | relLangURL }}">
<img src="{{ $invertedLogo | absURL }}" id="logo"> <img src="{{ $invertedLogo | relURL }}" id="logo">
{{- .Site.Title -}} {{- site.Title -}}
</a> </a>
<button <button
class="navbar-toggler navbar-dark" class="navbar-toggler navbar-dark"
@ -77,7 +77,7 @@
<a class="nav-link" id="blog-link" href="{{ "/posts" | relLangURL }}">{{ i18n "posts" }}</a> <a class="nav-link" id="blog-link" href="{{ "/posts" | relLangURL }}">{{ i18n "posts" }}</a>
</li> </li>
{{ end }} {{ end }}
{{ range (index .Site.Data .Site.Language.Lang).site.customMenus }} {{ range (index site.Data site.Language.Lang).site.customMenus }}
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="{{ .url }}">{{ .name }}</a> <a class="nav-link" href="{{ .url }}">{{ .name }}</a>
</li> </li>
@ -89,6 +89,6 @@
</div> </div>
</div> </div>
<!-- Store the logo information in a hidden img for the JS --> <!-- Store the logo information in a hidden img for the JS -->
<img src="{{ $mainLogo | absURL }}" class="d-none" id="main-logo"> <img src="{{ $mainLogo | relURL }}" class="d-none" id="main-logo">
<img src="{{ $invertedLogo | absURL }}" class="d-none" id="inverted-logo"> <img src="{{ $invertedLogo | relURL }}" class="d-none" id="inverted-logo">
</nav> </nav>

View file

@ -38,7 +38,7 @@
</ul> </ul>
</div> </div>
{{ if .resume }} {{ if .resume }}
<a href="{{ .resume | absURL }}" target="#" <a href="{{ .resume | relURL }}" target="#"
><button class="btn btn-dark">{{ i18n "resume"}}</button></a ><button class="btn btn-dark">{{ i18n "resume"}}</button></a
> >
{{ end }} {{ end }}

View file

@ -1,6 +1,6 @@
<div <div
class="achievement-entry text-center" class="achievement-entry text-center"
style="background-image: url({{ .image | absURL }});" style="background-image: url('{{ strings.TrimSuffix "/" site.BaseURL }}{{ .image | relURL }}');"
> >
<i class="fas fa-search-plus" id="enlarge-icon"></i> <i class="fas fa-search-plus" id="enlarge-icon"></i>
<h4 class="title" id="achievement-title">{{ .title }}</h4> <h4 class="title" id="achievement-title">{{ .title }}</h4>

View file

@ -1,6 +1,6 @@
{{ $author:= .Site.Data.author }} {{ $author:= site.Data.author }}
{{ if (index .Site.Data .Site.Language.Lang).author }} {{ if (index site.Data site.Language.Lang).author }}
{{ $author = (index .Site.Data .Site.Language.Lang).author }} {{ $author = (index site.Data site.Language.Lang).author }}
{{ end }} {{ end }}
{{ $name:="Jane Doe" }} {{ $name:="Jane Doe" }}
@ -10,17 +10,17 @@
{{ $name = $author.name }} {{ $name = $author.name }}
{{ end }} {{ end }}
{{ $sections:= .Site.Data.sections }} {{ $sections:= site.Data.sections }}
{{ if (index .Site.Data .Site.Language.Lang).sections }} {{ if (index site.Data site.Language.Lang).sections }}
{{ $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 }}
@ -28,10 +28,10 @@
<div class="container-fluid home" id="home"> <div class="container-fluid home" id="home">
<div <div
class="background container-fluid" class="background container-fluid"
style="background-image: url('{{ $backgroundImage | absURL }}');" style="background-image: url('{{ strings.TrimSuffix "/" site.BaseURL }}{{ $backgroundImage | relURL }}');"
></div> ></div>
<div class="container content text-center"> <div class="container content text-center">
<img src="{{ $authorImage | absURL }}" <img src="{{ $authorImage | relURL }}"
class="rounded-circle mx-auto d-block img-fluid" class="rounded-circle mx-auto d-block img-fluid"
/> />
<h1 class="greeting"> {{ $author.greeting }} {{ $name }}</h1> <h1 class="greeting"> {{ $author.greeting }} {{ $name }}</h1>