fixed bug

This commit is contained in:
Nuno Coração 2022-10-20 12:15:37 +01:00
parent 03cf3aec76
commit c64eac525a
5 changed files with 19 additions and 4 deletions

View file

Before

Width:  |  Height:  |  Size: 4.8 MiB

After

Width:  |  Height:  |  Size: 4.8 MiB

View file

@ -23,7 +23,7 @@ mainSections = ["docs"]
[homepage] [homepage]
layout = "custom" # valid options: page, profile, hero, card, background, custom 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 showRecent = true
showRecentItems = 5 showRecentItems = 5
showMoreLink = true showMoreLink = true

View file

@ -4,13 +4,18 @@
<div class="mx-auto max-w-7xl p-0"> <div class="mx-auto max-w-7xl p-0">
<div class="relative sm:overflow-hidden"> <div class="relative sm:overflow-hidden">
<div class="absolute inset-0"> <div class="absolute inset-0">
<img class="h-full w-full object-cover m-0 nozoom" src="{{ .Site.Params.homepage.homepageImage }}"> {{ with .Site.Params.homepage.homepageImage }}
{{ $homepageImage := resources.Get . }}
{{ if $homepageImage }}
<img class="h-full w-full object-cover m-0 nozoom" src="{{ $homepageImage.RelPermalink }}">
<div <div
class="absolute inset-0 bg-gradient-to-t from-neutral-100 dark:from-neutral-800 to-transparent dark:to-neutral-300 mix-blend-normal dark:mix-blend-multiply"> class="absolute inset-0 bg-gradient-to-t from-neutral-100 dark:from-neutral-800 to-transparent dark:to-neutral-300 mix-blend-normal dark:mix-blend-multiply">
</div> </div>
<div <div
class="absolute inset-0 bg-gradient-to-t from-neutral dark:from-neutral-800 to-transparent mix-blend-normal"> class="absolute inset-0 bg-gradient-to-t from-neutral dark:from-neutral-800 to-transparent mix-blend-normal">
</div> </div>
{{ end }}
{{ end }}
</div> </div>
<div class="relative px-4 py-16 sm:px-6 sm:py-24 lg:py-32 lg:px-8 flex flex-col items-center"> <div class="relative px-4 py-16 sm:px-6 sm:py-24 lg:py-32 lg:px-8 flex flex-col items-center">
{{ with .Site.Author.image }} {{ with .Site.Author.image }}

View file

@ -14,8 +14,13 @@
</div> </div>
<div class="mt-6 sm:mt-16 lg:mt-0"> <div class="mt-6 sm:mt-16 lg:mt-0">
<div class="-mr-48 pl-4 sm:pl-6 md:-mr-16 lg:relative lg:m-0 lg:h-full lg:px-0"> <div class="-mr-48 pl-4 sm:pl-6 md:-mr-16 lg:relative lg:m-0 lg:h-full lg:px-0">
{{ with .Site.Params.homepage.homepageImage }}
{{ $homepageImage := resources.Get . }}
{{ if $homepageImage }}
<img class="w-full rounded-xl shadow-xl lg:absolute lg:left-0 lg:h-full lg:w-auto lg:max-w-none" <img class="w-full rounded-xl shadow-xl lg:absolute lg:left-0 lg:h-full lg:w-auto lg:max-w-none"
src="{{ .Site.Params.homepage.homepageImage }}"> src="{{ $homepageImage.RelPermalink }}">
{{ end }}
{{ end }}
</div> </div>
</div> </div>
</div> </div>

View file

@ -4,10 +4,15 @@
<div class="mx-auto max-w-7xl p-0"> <div class="mx-auto max-w-7xl p-0">
<div class="relative shadow-xl sm:overflow-hidden rounded-2xl"> <div class="relative shadow-xl sm:overflow-hidden rounded-2xl">
<div class="absolute inset-0"> <div class="absolute inset-0">
<img class="h-full w-full object-cover m-0 nozoom" src="{{ .Site.Params.homepage.homepageImage }}"> {{ with .Site.Params.homepage.homepageImage }}
{{ $homepageImage := resources.Get . }}
{{ if $homepageImage }}
<img class="h-full w-full object-cover m-0 nozoom" src="{{ $homepageImage.RelPermalink }}">
<div <div
class="absolute inset-0 bg-gradient-to-r from-primary-500 to-secondary-700 dark:from-primary-600 dark:to-secondary-800 mix-blend-multiply"> class="absolute inset-0 bg-gradient-to-r from-primary-500 to-secondary-700 dark:from-primary-600 dark:to-secondary-800 mix-blend-multiply">
</div> </div>
{{ end }}
{{ end }}
</div> </div>
<div class="relative px-4 py-16 sm:px-6 sm:py-24 lg:py-32 lg:px-8 flex flex-col items-center"> <div class="relative px-4 py-16 sm:px-6 sm:py-24 lg:py-32 lg:px-8 flex flex-col items-center">
{{ with .Site.Author.image }} {{ with .Site.Author.image }}