diff --git a/package.json b/package.json index 392adb1..f588ee7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "sveltekit-blog-starter", - "version": "2.0.2", + "name": "data-only-greater", + "version": "2.0.1", "type": "module", "scripts": { "build": "vite build", diff --git a/src/routes/blog/+page.server.js b/src/routes/blog/+page.server.js index 793262b..9a5ce94 100644 --- a/src/routes/blog/+page.server.js +++ b/src/routes/blog/+page.server.js @@ -1,5 +1,7 @@ import { postsPerPage } from "$lib/config"; +export const trailingSlash = "always"; + export const load = async ({ url, fetch }) => { const postRes = await fetch(`${url.origin}/api/posts.json`); const posts = await postRes.json(); @@ -12,14 +14,14 @@ export const load = async ({ url, fetch }) => { const links = [ { title: "Latest", - href: "blog", + href: "", }, ]; if (pagesAvailable > 1) { links.push({ title: "Older", - href: "/blog/page/2", + href: "page/2", }); } diff --git a/src/routes/blog/page/+page.server.js b/src/routes/blog/page/+page.server.js index 81be538..f8ab905 100644 --- a/src/routes/blog/page/+page.server.js +++ b/src/routes/blog/page/+page.server.js @@ -1,5 +1,7 @@ import { redirect } from "@sveltejs/kit"; +export const trailingSlash = "always"; + export const load = () => { redirect(301, "/blog"); };