|
|
|
@ -10,23 +10,24 @@ export default {
|
|
|
|
prerender: {
|
|
|
|
prerender: {
|
|
|
|
// TODO: REMOVE
|
|
|
|
// TODO: REMOVE
|
|
|
|
handleMissingId: 'ignore',
|
|
|
|
handleMissingId: 'ignore',
|
|
|
|
entries: ['*', ...replJsonEntries(), ...tutorialEntries()],
|
|
|
|
// TODO use route entries instead, once https://github.com/sveltejs/kit/pull/9571 is merged
|
|
|
|
|
|
|
|
entries: ['*', ...repl_json_entries(), ...tutorial_entries()],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/** @returns {('*' | `/${string}`)[]} */
|
|
|
|
function repl_json_entries() {
|
|
|
|
function replJsonEntries() {
|
|
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
|
|
|
return get_examples_list(
|
|
|
|
return get_examples_list(
|
|
|
|
get_examples_data(new URL('../../site/content/examples', import.meta.url).pathname)
|
|
|
|
get_examples_data(new URL('../../site/content/examples', import.meta.url).pathname)
|
|
|
|
).flatMap(({ examples }) => examples.map(({ slug }) => `/repl/${slug}.json`));
|
|
|
|
).flatMap(({ examples }) =>
|
|
|
|
|
|
|
|
examples.map(({ slug }) => /** @type {(`/${string}`)} */ (`/repl/${slug}.json`))
|
|
|
|
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/** @returns {('*' | `/${string}`)[]} */
|
|
|
|
function tutorial_entries() {
|
|
|
|
function tutorialEntries() {
|
|
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
|
|
|
|
return get_tutorial_list(
|
|
|
|
return get_tutorial_list(
|
|
|
|
get_tutorial_data(new URL('../../site/content/tutorial', import.meta.url).pathname)
|
|
|
|
get_tutorial_data(new URL('../../site/content/tutorial', import.meta.url).pathname)
|
|
|
|
).flatMap(({ tutorials }) => tutorials.map(({ slug }) => `/tutorial/${slug}`));
|
|
|
|
).flatMap(({ tutorials }) =>
|
|
|
|
|
|
|
|
tutorials.map(({ slug }) => /** @type {(`/${string}`)} */ (`/tutorial/${slug}`))
|
|
|
|
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|