diff --git a/src/routes/gruppi/[slug]/+page.svelte b/src/routes/gruppi/[slug]/+page.svelte index fd9307a..86250cf 100644 --- a/src/routes/gruppi/[slug]/+page.svelte +++ b/src/routes/gruppi/[slug]/+page.svelte @@ -5,6 +5,7 @@ import { goto } from '$app/navigation'; const { data } = $props(); + $inspect(data); const sortedProjects = $derived( data.gruppo.progetti.sort((a, b) => { if (a.modulo < b.modulo) return -1; @@ -24,12 +25,13 @@ ); }); - const prevIndex = $derived(currentIndex > 0 ? currentIndex - 1 : data.gruppo.gruppi.length - 1); - - const nextIndex = $derived(currentIndex < data.gruppo.gruppi.length - 1 ? currentIndex + 1 : 0); + const prevIndex = $derived( + currentIndex > 0 ? currentIndex - 1 : data?.gruppo?.gruppi?.length - 1 + ); - const prevGroup = $derived(data.gruppo.gruppi[prevIndex]); - const nextGroup = $derived(data.gruppo.gruppi[nextIndex]); + const nextIndex = $derived( + currentIndex < data?.gruppo?.gruppi?.length - 1 ? currentIndex + 1 : 0 + ); {#if data.gruppo} diff --git a/svelte.config.js b/svelte.config.js index 325dfee..1142343 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -4,7 +4,11 @@ import adapter from '@sveltejs/adapter-static'; const config = { kit: { adapter: adapter({ - fallback: '404.html' + fallback: '404.html', + pages: 'build', + assets: 'build', + precompress: false, + strict: true }), paths: { base: process.argv.includes('dev') ? '' : process.env.PUBLIC_BASE_PATH