From 16ea1c91aea5fdedbf50059518d4d55f9b8cbe50 Mon Sep 17 00:00:00 2001 From: Robert Schuster Date: Sun, 28 Dec 2025 13:38:26 +0100 Subject: [PATCH 1/9] feat: modified font and loading config --- assets/sass/fonts.scss | 25 ++++++++++++++++++++++++- layouts/_default/home.html | 2 +- layouts/partials/head/js.html | 1 + layouts/partials/image.html | 6 ++++++ 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/assets/sass/fonts.scss b/assets/sass/fonts.scss index fd401ac3c..e4461ccac 100644 --- a/assets/sass/fonts.scss +++ b/assets/sass/fonts.scss @@ -3,6 +3,9 @@ font-family: "Roboto"; font-style: normal; font-display: swap; + ascent-override: 93%; + descent-override: 24%; + line-gap-override: 0%; font-weight: 100; src: url(@fontsource/roboto/files/roboto-latin-100-normal.woff2) format("woff2"), @@ -18,6 +21,9 @@ font-family: "Roboto"; font-style: normal; font-display: swap; + ascent-override: 93%; + descent-override: 24%; + line-gap-override: 0%; font-weight: 400; src: url(@fontsource/roboto/files/roboto-latin-400-normal.woff2) format("woff2"), @@ -33,6 +39,9 @@ font-family: "Roboto"; font-style: normal; font-display: swap; + ascent-override: 93%; + descent-override: 24%; + line-gap-override: 0%; font-weight: 700; src: url(@fontsource/roboto/files/roboto-latin-700-normal.woff2) format("woff2"), @@ -48,6 +57,9 @@ font-family: "Roboto"; font-style: italic; font-display: swap; + ascent-override: 93%; + descent-override: 24%; + line-gap-override: 0%; font-weight: 100; src: url(@fontsource/roboto/files/roboto-latin-100-italic.woff2) format("woff2"), @@ -63,6 +75,9 @@ font-family: "Roboto"; font-style: italic; font-display: swap; + ascent-override: 93%; + descent-override: 24%; + line-gap-override: 0%; font-weight: 400; src: url(@fontsource/roboto/files/roboto-latin-400-italic.woff2) format("woff2"), @@ -78,6 +93,9 @@ font-family: "Roboto"; font-style: italic; font-display: swap; + ascent-override: 93%; + descent-override: 24%; + line-gap-override: 0%; font-weight: 700; src: url(@fontsource/roboto/files/roboto-latin-700-italic.woff2) format("woff2"), @@ -93,6 +111,9 @@ font-family: "Sansita"; font-style: normal; font-display: swap; + ascent-override: 102%; + descent-override: 18%; + line-gap-override: 0%; font-weight: 800; src: url(@fontsource/sansita/files/sansita-latin-800-normal.woff2) @@ -109,6 +130,9 @@ font-family: "Material Symbols Rounded"; font-style: normal; font-display: swap; + ascent-override: 110%; + descent-override: 10%; + line-gap-override: 0%; font-weight: 400; src: url(@fontsource/material-symbols-rounded/files/material-symbols-rounded-latin-400-normal.woff2) @@ -119,7 +143,6 @@ U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; - font-display: block; // Do not display icons until font is fully loaded } body, diff --git a/layouts/_default/home.html b/layouts/_default/home.html index 1b9794206..b63dc3ee5 100644 --- a/layouts/_default/home.html +++ b/layouts/_default/home.html @@ -7,7 +7,7 @@
{{ $image := resources.Get "images/startpage.webp" }} - {{ partial "image" (dict "image" $image "eager" true) }} + {{ partial "image" (dict "image" $image "eager" true "fetchpriority" "high") }}
diff --git a/layouts/partials/head/js.html b/layouts/partials/head/js.html index cf3c3c122..c73dbaa29 100644 --- a/layouts/partials/head/js.html +++ b/layouts/partials/head/js.html @@ -12,6 +12,7 @@ src="{{ .RelPermalink }}" integrity="{{- .Data.Integrity }}" crossorigin="anonymous" + defer > {{- end }} {{- end }} diff --git a/layouts/partials/image.html b/layouts/partials/image.html index d4c96b815..8f86d46f9 100644 --- a/layouts/partials/image.html +++ b/layouts/partials/image.html @@ -6,6 +6,11 @@ {{- $loading = "eager" -}} {{- end -}} +{{- $fetchpriority := "auto" -}} +{{- if .fetchpriority -}} + {{- $fetchpriority = .fetchpriority -}} +{{- end -}} + {{- $name := $image.RelPermalink | strings.TrimSuffix (printf ".%s" $image.MediaType.SubType) -}} {{- $extension := $image.MediaType.SubType -}} @@ -50,6 +55,7 @@ data-decorative="true" {{- end }} loading="{{ $loading }}" + fetchpriority="{{ $fetchpriority }}" srcset="{{ delimit $srcset ", " }}" sizes="(max-width: 576px) calc(100vw - 3.2rem), (max-width: 768px) 540px, (max-width: 992px) 720px, (max-width: 1200px) 960px, (max-width: 1400px) 1140px, 1320px" style="{{ delimit $styles "; " | safeCSS }}" From b8a2fea42f303f6a8f727831991220972f2b1110 Mon Sep 17 00:00:00 2001 From: Robert Schuster Date: Sun, 28 Dec 2025 14:48:32 +0100 Subject: [PATCH 2/9] refactor: merged pagefind css --- assets/sass/search.scss | 283 ++++++++++++++++++++++--------------- layouts/partials/head.html | 1 - 2 files changed, 172 insertions(+), 112 deletions(-) diff --git a/assets/sass/search.scss b/assets/sass/search.scss index 16f6bfaaf..5b6e899c0 100644 --- a/assets/sass/search.scss +++ b/assets/sass/search.scss @@ -1,5 +1,8 @@ $search-z-index: 12; +// --------------------------------------------- +// SEARCH BLOCK (ID bleibt erhalten) +// --------------------------------------------- #search { width: 100%; display: flex; @@ -9,142 +12,200 @@ $search-z-index: 12; display: none; } - .pagefind-ui__search-input, - .pagefind-ui__message { - font-family: "Roboto", Arial, Helvetica, sans-serif; - font-weight: 400; - } - - .pagefind-ui__message { - padding: 1rem; - } + // --------------------------------------------- + // PAGEFIND BLOCK + // --------------------------------------------- + .pagefind-ui { + width: 100%; - .pagefind-ui__results-area { - margin-top: 0; - max-height: 50vh; - padding: 0 1rem; - overflow-y: scroll; + &__form { + position: relative; + + &::before { + content: "search"; + position: absolute; + top: 23px; + left: 20px; + z-index: $search-z-index + 1; + font-family: "Material Symbols Rounded"; + opacity: 0.7; + pointer-events: none; + line-height: 1; + } + } - @media (max-width: #{$breakpoint-md}) { - max-height: calc(100dvh - 17rem); + &__message { + padding: 1rem; } - } - .pagefind-ui__results li:last-child { - border-bottom: none; - } + &__results-area { + max-height: 50vh; + padding: 0 2rem; + overflow-y: scroll; - input.pagefind-ui__search-input { - z-index: $search-z-index; - outline: 0.2rem solid transparent; - border: var(--border); - box-shadow: var(--box-shadow); - border-radius: var(--border-radius-l); + @media (max-width: #{$breakpoint-md}) { + max-height: calc(100dvh - 17rem); + } + } - @include focus-indicator(0.2rem); + &__results { + padding-left: 0; + margin-bottom: 0; + } - &::placeholder { - opacity: 0.7; + // --------------------------------------------- + // SEARCH INPUT + // --------------------------------------------- + &__search-input { + z-index: $search-z-index; + outline: 0.2rem solid transparent; + border: var(--border); + box-shadow: var(--box-shadow); + border-radius: var(--border-radius-l); + height: 64px; + background-color: var(--bg-default); color: var(--color-body); + padding: 0 70px 0 54px; + font-size: 2rem; + position: relative; + display: flex; + width: 100%; + box-sizing: border-box; + + @include focus-indicator(0.2rem); + + &::placeholder { + opacity: 0.7; + color: var(--color-body); + } + + // Wenn Ergebnisse sichtbar sind + &:has( + + .pagefind-ui__search-clear + + .pagefind-ui__drawer + .pagefind-ui__results-area + ) { + border-radius: var(--border-radius-l) var(--border-radius-l) 0 0; + } } - // This selector is used to identify if search results are visible - &:has( - + .pagefind-ui__search-clear - + .pagefind-ui__drawer - .pagefind-ui__results-area - ) { - border-radius: var(--border-radius-l) var(--border-radius-l) 0 0; + &__search-clear { + display: none; } - } - - button.pagefind-ui__search-clear { - display: none; - } - - .pagefind-ui__suppressed { - display: none; - } - .pagefind-ui__form::before { - z-index: $search-z-index + 1; - } - - .pagefind-ui__drawer { - background-color: var(--bg-default); - padding: 0; - overscroll-behavior: contain; - overflow: hidden; - position: absolute; - width: 100%; - z-index: $search-z-index; - border: var(--border); - border-radius: 0 0 var(--border-radius-l) var(--border-radius-l); - } - - .pagefind-ui__result { - padding: 2rem 0; - margin: 0 1rem; - border-top: 0.2rem solid grey; - } - - .pagefind-ui__result-inner, - .pagefind-ui__result-thumb { - margin-top: 0; - } - - .pagefind-ui__result-thumb { - width: 10rem; - - @media (max-width: #{$breakpoint-md}) { + &__suppressed { display: none; } - } - - .pagefind-ui__result-link { - color: var(--link-default); - text-decoration: underline; - border-radius: var(--border-radius-s); - &:hover, - &:focus { - color: var(--link-hovered); + // --------------------------------------------- + // DRAWER + // --------------------------------------------- + &__drawer { + background-color: var(--bg-default); + overscroll-behavior: contain; + overflow: hidden; + position: absolute; + width: 100%; + z-index: $search-z-index; + border: var(--border); + border-radius: 0 0 var(--border-radius-l) var(--border-radius-l); + box-sizing: border-box; } - } - .pagefind-ui__result-link:hover, - .pagefind-ui__result-link:focus { - color: var(--link-hovered); - } + // --------------------------------------------- + // RESULT LIST + // --------------------------------------------- + &__result { + list-style-type: none; + display: flex; + align-items: flex-start; + gap: 3.2rem; + padding: 2rem 0; + border-top: 0.2rem solid grey; + + &-inner, + &-thumb { + margin-top: 0; + } + + &-thumb { + width: 10rem; + + @media (max-width: #{$breakpoint-md}) { + display: none; + } + } + + &-title { + display: inline-block; + font-weight: 700; + margin: 0; + } + + &-nested { + display: flex; + flex-direction: column; + padding-top: 0.8rem; + padding-left: 2.4rem; + + .pagefind-ui__result-link::before { + content: "subdirectory_arrow_right"; + font-family: "Material Symbols Rounded"; + position: absolute; + right: calc(100% + 0.1em); + } + } + + &-excerpt { + margin-bottom: 0; + } + } - .pagefind-ui__result-link { - @include focus-indicator(0.2rem); - } + // --------------------------------------------- + // LINKS + // --------------------------------------------- + &__result-link { + position: relative; + } - .pagefind-ui__result-link::before { - top: -0.2rem; - } + // --------------------------------------------- + // BUTTON + // --------------------------------------------- + &__button { + border: 0.2rem solid var(--link-default); + border-radius: var(--border-radius-m); + background: transparent; + height: 4.8rem; + padding: 1.2rem; + width: 100%; + text-align: center; + font-weight: 700; + transition: + background 0.2s, + color 0.2s; + + &:hover, + &:focus { + background: rgba($link-hovered, 0.15); + } + } - .pagefind-ui--reset mark { - background-color: var(--bg-accent); - color: black; - } + &__hidden { + display: none; + } - button.pagefind-ui__button { - border: 0.2rem solid var(--link-default); - border-radius: var(--border-radius-m); - background: transparent; - color: var(--body-color); - margin-top: 0; - margin-bottom: 1rem; - - &:hover, - &:focus { - background: rgba($link-hovered, 0.15); + &--reset { + mark { + background-color: var(--bg-accent); + color: black; + } } } } +// --------------------------------------------- +// SEARCH OVERLAY MODIFIER +// --------------------------------------------- .o-search { &--contentpage { position: fixed; diff --git a/layouts/partials/head.html b/layouts/partials/head.html index e6a01a4d3..87412c490 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -19,7 +19,6 @@ as="style" /> {{ end }} - +{{ partialCached "head/js" . }} + From 96466e6f25c981480397fe9348bc046e3f509e79 Mon Sep 17 00:00:00 2001 From: Robert Schuster Date: Thu, 8 Jan 2026 20:35:56 +0100 Subject: [PATCH 7/9] prettier --- layouts/partials/head.html | 1 + 1 file changed, 1 insertion(+) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 282fd1de0..c4943356f 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -26,6 +26,7 @@ {{ partialCached "head/js" . }} + From 50551c4e77386aff7bcaac2ed03c35cd33b51444 Mon Sep 17 00:00:00 2001 From: Robert Schuster Date: Thu, 8 Jan 2026 20:41:34 +0100 Subject: [PATCH 8/9] fix: removed font metric overrides --- assets/sass/fonts.scss | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/assets/sass/fonts.scss b/assets/sass/fonts.scss index de6872877..8b5202314 100644 --- a/assets/sass/fonts.scss +++ b/assets/sass/fonts.scss @@ -3,9 +3,6 @@ font-family: "Roboto"; font-style: normal; font-display: swap; - ascent-override: 93%; - descent-override: 24%; - line-gap-override: 0%; font-weight: 100; src: url(@fontsource/roboto/files/roboto-latin-100-normal.woff2) format("woff2"), @@ -21,9 +18,6 @@ font-family: "Roboto"; font-style: normal; font-display: swap; - ascent-override: 93%; - descent-override: 24%; - line-gap-override: 0%; font-weight: 400; src: url(@fontsource/roboto/files/roboto-latin-400-normal.woff2) format("woff2"), @@ -39,9 +33,6 @@ font-family: "Roboto"; font-style: normal; font-display: swap; - ascent-override: 93%; - descent-override: 24%; - line-gap-override: 0%; font-weight: 700; src: url(@fontsource/roboto/files/roboto-latin-700-normal.woff2) format("woff2"), @@ -57,9 +48,6 @@ font-family: "Roboto"; font-style: italic; font-display: swap; - ascent-override: 93%; - descent-override: 24%; - line-gap-override: 0%; font-weight: 100; src: url(@fontsource/roboto/files/roboto-latin-100-italic.woff2) format("woff2"), @@ -75,9 +63,6 @@ font-family: "Roboto"; font-style: italic; font-display: swap; - ascent-override: 93%; - descent-override: 24%; - line-gap-override: 0%; font-weight: 400; src: url(@fontsource/roboto/files/roboto-latin-400-italic.woff2) format("woff2"), @@ -93,9 +78,6 @@ font-family: "Roboto"; font-style: italic; font-display: swap; - ascent-override: 93%; - descent-override: 24%; - line-gap-override: 0%; font-weight: 700; src: url(@fontsource/roboto/files/roboto-latin-700-italic.woff2) format("woff2"), @@ -111,9 +93,6 @@ font-family: "Sansita"; font-style: normal; font-display: swap; - ascent-override: 102%; - descent-override: 18%; - line-gap-override: 0%; font-weight: 800; src: url(@fontsource/sansita/files/sansita-latin-800-normal.woff2) @@ -130,9 +109,6 @@ font-family: "Material Symbols Rounded"; font-style: normal; font-display: swap; - ascent-override: 110%; - descent-override: 10%; - line-gap-override: 0%; font-weight: 400; src: url(@fontsource/material-symbols-rounded/files/material-symbols-rounded-latin-400-normal.woff2) From b5f7174e91b47a861f8cc7665c3e74cc8b72c48a Mon Sep 17 00:00:00 2001 From: Robert Schuster Date: Thu, 8 Jan 2026 21:00:15 +0100 Subject: [PATCH 9/9] fix: fixed search.scss --- assets/sass/search.scss | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/assets/sass/search.scss b/assets/sass/search.scss index c9d29a802..47ea2d884 100644 --- a/assets/sass/search.scss +++ b/assets/sass/search.scss @@ -31,11 +31,12 @@ $search-z-index-focus: 12; &__message { padding: 1rem; + margin-bottom: 0; } &__results-area { max-height: 50vh; - padding: 0 2rem; + padding: 0 1rem; overflow-y: scroll; @media (max-width: #{$breakpoint-md}) { @@ -63,6 +64,7 @@ $search-z-index-focus: 12; display: flex; width: 100%; box-sizing: border-box; + font-family: "Roboto", Arial, Helvetica, sans-serif; @include focus-indicator(0.2rem); @@ -108,6 +110,7 @@ $search-z-index-focus: 12; gap: 3.2rem; padding: 2rem 0; border-top: 0.2rem solid grey; + margin: 0 1rem; &-inner, &-thumb { @@ -134,11 +137,15 @@ $search-z-index-focus: 12; padding-top: 0.8rem; padding-left: 2.4rem; + .pagefind-ui__result-link { + font-size: 1.8rem; + } + .pagefind-ui__result-link::before { content: "subdirectory_arrow_right"; font-family: "Material Symbols Rounded"; position: absolute; - right: calc(100% + 0.1em); + left: -2.4rem; } } @@ -149,12 +156,14 @@ $search-z-index-focus: 12; &__result-link { position: relative; + font-size: 2.2rem; } &__button { border: 0.2rem solid var(--link-default); border-radius: var(--border-radius-m); background: transparent; + color: var(--body-color); height: 4.8rem; padding: 1.2rem; margin-bottom: 1rem;