Skip to content

Commit

Permalink
site should be fully static
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniele Ciminieri committed Sep 18, 2024
1 parent 4c24971 commit 2d3b18a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
12 changes: 7 additions & 5 deletions src/routes/gruppi/[slug]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
);
</script>
{#if data.gruppo}
Expand Down
6 changes: 5 additions & 1 deletion svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2d3b18a

Please sign in to comment.