diff --git a/.github/workflows/merge-to-main.yml b/.github/workflows/merge-to-main.yml index 691bf0c..9722dd5 100644 --- a/.github/workflows/merge-to-main.yml +++ b/.github/workflows/merge-to-main.yml @@ -10,6 +10,6 @@ jobs: runs-on: ubuntu-latest steps: # Create/Update release draft - - uses: release-drafter/release-drafter@v6.0.0 + - uses: release-drafter/release-drafter@v6.1.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 7a13cf1..db089a7 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -80,4 +80,4 @@ jobs: # checkout to latest commit - uses: actions/checkout@v4.2.2 # run markdown linter - - uses: gaurav-nelson/github-action-markdown-link-check@1.0.15 + - uses: gaurav-nelson/github-action-markdown-link-check@1.0.16 diff --git a/layouts/partials/sections/home.html b/layouts/partials/sections/home.html index 9dddf46..3f244a2 100644 --- a/layouts/partials/sections/home.html +++ b/layouts/partials/sections/home.html @@ -20,6 +20,10 @@ {{ $backgroundImage = site.Params.background }} {{ end }} +{{ $darkBackgroundImage:= $backgroundImage }} +{{ if site.Params.darkBackground }} + {{ $darkBackgroundImage = site.Params.darkBackground }} +{{ end }} {{ $authorImage:= "/images/default-avatar.png" }} {{ if $author.image }} @@ -73,6 +77,41 @@ {{ $large := $src}} {{ end }} +{{/* get file that matches the filename as specified as src="" in shortcode */}} +{{ $darkSrc := resources.Get $darkBackgroundImage }} + +{{/* resize the src image to the given sizes */}} + +{{ $darkTiny := $darkSrc.Resize $tinyw }} +{{ $darkSmall := $darkSrc.Resize $smallw }} +{{ $darkMedium := $darkSrc.Resize $mediumw }} +{{ $darkLarge := $darkSrc.Resize $largew }} + +{{/* only use images smaller than or equal to the src (original) image size, as Hugo will upscale small images */}} +{{/* set the sizes attribute to (min-width: 35em) 1200px, 100vw unless overridden in shortcode */}} + +{{ if lt $darkSrc.Width "500" }} + {{ $darkTiny := $src}} + {{ $darkSmall := $src}} + {{ $darkMedium := $src}} + {{ $darkLarge := $src}} +{{ end }} + +{{ if lt $src.Width "800" }} + {{ $darkSmall := $src}} + {{ $darkMedium := $src}} + {{ $darkLarge := $src}} +{{ end }} + +{{ if lt $src.Width "1200" }} + {{ $darkMedium := $src}} + {{ $darkLarge := $src}} +{{ end }} + +{{ if lt $src.Width "1500" }} + {{ $darkLarge := $src}} +{{ end }} +