fix: 404 on refresh bug #3
|
@ -1 +1,4 @@
|
||||||
export const prerender = true;
|
export const prerender = true;
|
||||||
|
|
||||||
|
// Prevent page 404 on refresh
|
||||||
|
export const trailingSlash = 'always';
|
||||||
|
|
|
@ -7,7 +7,7 @@ export const load: PageLoad = async ({ params }) => {
|
||||||
const allPosts = await Promise.all(
|
const allPosts = await Promise.all(
|
||||||
iterablePostFiles.map(async ([pathMarkdown, resolver]) => {
|
iterablePostFiles.map(async ([pathMarkdown, resolver]) => {
|
||||||
const { metadata } = await resolver();
|
const { metadata } = await resolver();
|
||||||
const pathPost = "post/" + pathMarkdown.slice(pathMarkdown.lastIndexOf("/") + 1, -".md".length);
|
const pathPost = pathMarkdown.slice(pathMarkdown.lastIndexOf("/") + 1, -".md".length);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
meta: {
|
meta: {
|
|
@ -33,7 +33,13 @@ const config = {
|
||||||
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
|
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
|
||||||
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
|
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
|
||||||
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
|
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
|
||||||
adapter: adapter(),
|
adapter: adapter({
|
||||||
|
pages: "build",
|
||||||
|
assets: "build",
|
||||||
|
fallback: null,
|
||||||
|
precompress: false,
|
||||||
|
trailingSlash: 'always',
|
||||||
|
}),
|
||||||
alias: {
|
alias: {
|
||||||
$content: contentDir,
|
$content: contentDir,
|
||||||
"@/*": "./*",
|
"@/*": "./*",
|
||||||
|
|
Loading…
Reference in New Issue