feat: theme updates with **dynamic banner support**

This commit is contained in:
ae 2025-06-07 22:09:26 +03:00
parent 0de036f469
commit 10cbf4d1ac
Signed by: ae
GPG Key ID: 995EFD5C1B532B3E
14 changed files with 55 additions and 14 deletions

View File

@ -4,6 +4,12 @@ language: en-GB
theme: nostyleplease theme: nostyleplease
markup:
highlight:
codeFences: true
noClasses: true
style: nord
params: params:
theme_config: theme_config:
appearance: dark appearance: dark

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -15,7 +15,7 @@
"purpose": "maskable" "purpose": "maskable"
} }
], ],
"theme_color": "#252525", "theme_color": "#525252",
"background_color": "#252525", "background_color": "#525252",
"display": "standalone" "display": "standalone"
} }

View File

@ -54,7 +54,7 @@
} }
@mixin dark-appearance { @mixin dark-appearance {
@include theme(#000000, #f1fffa, #000000, #3aeb9d, #b7f8c6, #b1d2b8); @include theme(#000000, #f1fffa, #000000, #93b1b2, #c8e0f8, #b1b8d2);
} }
@mixin light-appearance { @mixin light-appearance {
@ -88,13 +88,11 @@ body {
header { header {
display: flex; display: flex;
align-items: center; align-items: center;
width: min-content; width: 100%;
} }
header > img { #banner {
max-width: 2.5rem; padding-bottom: 2rem;
max-height: 2.5rem;
padding-right: 1rem;
} }
h2, h3, h4, h5, h6 { margin-top: 1.5rem; } h2, h3, h4, h5, h6 { margin-top: 1.5rem; }
@ -129,6 +127,7 @@ table, th, td {
} }
code { code {
font-size: 15px;
text-size-adjust: 100%; text-size-adjust: 100%;
-ms-text-size-adjust: 100%; -ms-text-size-adjust: 100%;
-moz-text-size-adjust: 100%; -moz-text-size-adjust: 100%;
@ -194,5 +193,7 @@ details[open] summary {
} }
.site-footer { .site-footer {
display: flex;
justify-content: center;
margin-top: 2em; margin-top: 2em;
} }

View File

@ -1,12 +1,36 @@
{{ define "main" }} {{ define "main" }}
<header> <header>
<img src="/images/favicon.svg" /> <img id="banner" />
<h1>{{ $.Site.Title }}</h1>
{{- if $.Site.Params.theme_config.show_description -}} {{- if $.Site.Params.theme_config.show_description -}}
<p>{{ $.Site.Params.description }}</p> <p>{{ $.Site.Params.description }}</p>
{{- end -}} {{- end -}}
</header> </header>
{{ if hugo.IsProduction }}
<!-- prod implementation -->
<script>
fetch("/banners/")
.then((response) => response.text())
.then((html) => {
const parser = new DOMParser()
const doc = parser.parseFromString(html, "text/html")
const links = Array.from(doc.querySelectorAll('a[href$=".png"]'))
if (links.length > 0) {
const randomIdx = Math.floor(Math.random() * links.length)
const bannerPath = "/banners/" + links[randomIdx].getAttribute("href")
document.getElementById("banner").src = bannerPath
}
})
</script>
{{ else }}
<!-- dev fallback -->
<script>
document.getElementById("banner").src = "/images/banner-placeholder.png"
</script>
{{ end }}
{{ .Content }} {{ .Content }}
{{ partial "menu_item.html" (dict "context" . "collection" $.Site.Data.menu.entries) }} {{ partial "menu_item.html" (dict "context" . "collection" $.Site.Data.menu.entries) }}

View File

@ -1,3 +1,3 @@
<footer class="site-footer"> <footer class="site-footer">
<p>{{ now.Format "2006" }} / <a href="http://golfed6fzytoktol4de4o4nerap3xuykhfm5makfzscib65df3khnpyd.onion/" target="_blank" rel="noopener noreferrer">.onion</a> / <a href="/contact.txt" target="_blank" rel="noopener noreferrer">contact.txt</a> / <a href="https://umbrella.haus" target="_blank" rel="noopener noreferrer">umbrella.haus</a></p> <p><a href="http://golfed6fzytoktol4de4o4nerap3xuykhfm5makfzscib65df3khnpyd.onion/" target="_blank" rel="noopener noreferrer">.onion</a> // <a href="/contact.txt" target="_blank" rel="noopener noreferrer">contact.txt</a> // <a href="https://umbrella.haus" target="_blank" rel="noopener noreferrer">umbrella.haus</a></p>
</footer> </footer>