diff --git a/src/lib/Event.svelte b/src/lib/Event.svelte index 0887389..d813575 100644 --- a/src/lib/Event.svelte +++ b/src/lib/Event.svelte @@ -44,7 +44,7 @@
-
{e.name}
+
{e.name}
{#if e.speakers && e.speakers.length > 0}
{#each speakersMap(e.speakers) as s} @@ -65,7 +65,7 @@
{#each getParents(e) as pe}
- +
{#if pe.speakers.length === 0}
TBA
diff --git a/src/routes/lide.svelte b/src/routes/lide.svelte index 00a01d5..af8dfc8 100644 --- a/src/routes/lide.svelte +++ b/src/routes/lide.svelte @@ -8,7 +8,7 @@ import { goto } from '$app/navigation'; import Avatar from '$lib/Avatar.svelte'; import Event from '$lib/Event.svelte'; - import { onMount } from 'svelte'; + import { onMount, beforeUpdate } from 'svelte'; import { page } from '$app/stores'; import { bundle } from '$lib/stores.js'; @@ -18,12 +18,16 @@ $: s = $bundle ? $bundle.spec.speakers.find(s => s.id === id) : null $: events = s ? $bundle.spec.events.filter(ev => ev.speakers && ev.speakers.includes(s.id)) : [] - onMount(() => { + function loadItem () { const searchParams = new URLSearchParams($page.url.search) id = searchParams.get('id') if (!$bundle.spec.speakers.find(s => s.id === id)) { goto('/') } + } + + onMount(() => { + loadItem() }) function trackRender (trackId) { @@ -41,6 +45,10 @@ + + {s ? s.name : ''} | Lidé | {$bundle ? $bundle.name : 'UTXO.22'} + +
{#if $bundle && s}
diff --git a/src/routes/udalosti.svelte b/src/routes/udalosti/[id].svelte similarity index 90% rename from src/routes/udalosti.svelte rename to src/routes/udalosti/[id].svelte index 0195a8e..dc5e9d1 100644 --- a/src/routes/udalosti.svelte +++ b/src/routes/udalosti/[id].svelte @@ -15,13 +15,16 @@ let id = null $: e = $bundle ? $bundle.spec.events.find(ev => ev.id === id) : null - - onMount(() => { - const searchParams = new URLSearchParams($page.url.search) - id = searchParams.get('id') + + function loadItem () { + id = $page.params.id if (!$bundle.spec.events.find(ev => ev.id === id)) { goto('/program') } + } + + onMount(() => { + loadItem() }) function speakersMap (arr) { @@ -38,6 +41,10 @@ + + {e ? e.name : ''} | Události | {$bundle ? $bundle.name : 'UTXO.22'} + +
{#if $bundle && e}
diff --git a/src/routes/vstupenky.svelte b/src/routes/vstupenky.svelte index dd40d5d..1c68fee 100644 --- a/src/routes/vstupenky.svelte +++ b/src/routes/vstupenky.svelte @@ -246,7 +246,7 @@
- #{ticket.id} + #{ticket.id}
Běžná vstupenka
diff --git a/svelte.config.js b/svelte.config.js index fdd0013..7399368 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,5 +1,8 @@ import adapter from '@sveltejs/adapter-static' +import bundle from './src/lib/bundle.json' assert {type: "json"} +const entries = [] + /** @type {import('@sveltejs/kit').Config} */ const config = { kit: { @@ -8,7 +11,14 @@ const config = { // Override http methods in the Todo forms methodOverride: { allowed: ['PATCH', 'DELETE'] - } + }, + prerender: { + crawl: true, + entries: [ + '*', + ...entries + ] + } } };