Compare commits

...

3 Commits

Author SHA1 Message Date
148fe8eeff feat: add and update pre-commit
All checks were successful
test-build / guarddog (push) Successful in 17s
test-build / build (push) Successful in 4m8s
renovate / renovate (push) Successful in 1m35s
2026-03-15 16:56:54 -05:00
8d1d47dc4f fix: handle script with swup
All checks were successful
test-build / guarddog (push) Successful in 33s
test-build / build (push) Successful in 1m41s
renovate / renovate (push) Successful in 1m26s
2026-03-14 13:17:33 -05:00
7b8fb380d4 feat: enable prerender pending resoltuion of server island fix
All checks were successful
test-build / guarddog (push) Successful in 30s
test-build / build (push) Successful in 1m55s
renovate / renovate (push) Successful in 1m15s
2026-03-13 11:39:59 -05:00
3 changed files with 27 additions and 6 deletions

17
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,17 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-merge-conflict
- id: check-json
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.11
hooks:
- id: prettier
types_or: [javascript, typescript, css, scss, html, json, yaml, markdown]
additional_dependencies:
- prettier
- prettier-plugin-astro
- prettier-plugin-tailwindcss

View File

@@ -82,7 +82,7 @@ const images = await Promise.all(imagesData.map(async (img) => ({
</section> </section>
<script> <script>
document.addEventListener('astro:page-load', () => { function initHeroImage() {
const container = document.getElementById('hero-image-container'); const container = document.getElementById('hero-image-container');
if (container) { if (container) {
const images = container.querySelectorAll('.hero-image'); const images = container.querySelectorAll('.hero-image');
@@ -96,5 +96,13 @@ const images = await Promise.all(imagesData.map(async (img) => ({
images[randomIndex].classList.add('flex'); images[randomIndex].classList.add('flex');
} }
} }
}); }
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', initHeroImage);
} else {
initHeroImage();
}
if ((window as any).swup) {
(window as any).swup.hooks.on('page:view', initHeroImage);
}
</script> </script>

View File

@@ -11,10 +11,6 @@ import GiteaSection from '@components/sections/GiteaSection.astro';
import BaseLayout from '@layouts/BaseLayout.astro'; import BaseLayout from '@layouts/BaseLayout.astro';
import directus from '@lib/directus'; import directus from '@lib/directus';
// Weather section server island does not seem to load under Astro 6, setting the whole page for server
// side rendering for now.
export const prerender = false
const global = await directus.request(readSingleton('site_global')); const global = await directus.request(readSingleton('site_global'));
const weather = await directus.request(readSingleton('site_weather')); const weather = await directus.request(readSingleton('site_weather'));
const posts = await directus.request( const posts = await directus.request(