From c64eac525a76fe00e8d4f1f6ca55381bf4e16156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20Cora=C3=A7=C3=A3o?= Date: Thu, 20 Oct 2022 12:15:37 +0100 Subject: [PATCH] fixed bug --- exampleSite/{content => assets/img}/iceland.jpg | Bin exampleSite/config/_default/params.toml | 2 +- layouts/partials/home/background.html | 7 ++++++- layouts/partials/home/card.html | 7 ++++++- layouts/partials/home/hero.html | 7 ++++++- 5 files changed, 19 insertions(+), 4 deletions(-) rename exampleSite/{content => assets/img}/iceland.jpg (100%) diff --git a/exampleSite/content/iceland.jpg b/exampleSite/assets/img/iceland.jpg similarity index 100% rename from exampleSite/content/iceland.jpg rename to exampleSite/assets/img/iceland.jpg diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index 6c8959f8..1aec57d3 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -23,7 +23,7 @@ mainSections = ["docs"] [homepage] layout = "custom" # valid options: page, profile, hero, card, background, custom - homepageImage = "iceland.jpg" # used in: hero, and card + homepageImage = "/img/iceland.jpg" # used in: hero, and card showRecent = true showRecentItems = 5 showMoreLink = true diff --git a/layouts/partials/home/background.html b/layouts/partials/home/background.html index db5d6604..c095f84f 100644 --- a/layouts/partials/home/background.html +++ b/layouts/partials/home/background.html @@ -4,13 +4,18 @@
- + {{ with .Site.Params.homepage.homepageImage }} + {{ $homepageImage := resources.Get . }} + {{ if $homepageImage }} +
+ {{ end }} + {{ end }}
{{ with .Site.Author.image }} diff --git a/layouts/partials/home/card.html b/layouts/partials/home/card.html index 4fb1bb5d..3804450d 100644 --- a/layouts/partials/home/card.html +++ b/layouts/partials/home/card.html @@ -14,8 +14,13 @@
+ {{ with .Site.Params.homepage.homepageImage }} + {{ $homepageImage := resources.Get . }} + {{ if $homepageImage }} + src="{{ $homepageImage.RelPermalink }}"> + {{ end }} + {{ end }}
diff --git a/layouts/partials/home/hero.html b/layouts/partials/home/hero.html index 28d82276..a6b824f8 100644 --- a/layouts/partials/home/hero.html +++ b/layouts/partials/home/hero.html @@ -4,10 +4,15 @@
- + {{ with .Site.Params.homepage.homepageImage }} + {{ $homepageImage := resources.Get . }} + {{ if $homepageImage }} +
+ {{ end }} + {{ end }}
{{ with .Site.Author.image }}