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 }}