Skip to content

Commit

Permalink
Apply trailingSlash always globally
Browse files Browse the repository at this point in the history
  • Loading branch information
H0R5E committed May 14, 2024
1 parent e85b032 commit 3ed0c6e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-only-greater",
"version": "2.0.1",
"version": "2.0.0",
"type": "module",
"scripts": {
"build": "vite build",
Expand Down
3 changes: 3 additions & 0 deletions src/routes/+layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ export const prerender = true;
// Allows client side routing. Necessary for page transitions and link prefetching; change to false if you prefer ordinary routing without JS
export const csr = true;

// Always create index files for routes
export const trailingSlash = "always";

export const load = async ({ url }) => {
try {
return {
Expand Down
2 changes: 0 additions & 2 deletions src/routes/blog/+page.server.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
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();
Expand Down
2 changes: 0 additions & 2 deletions src/routes/blog/page/+page.server.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { redirect } from "@sveltejs/kit";

export const trailingSlash = "always";

export const load = () => {
redirect(301, "/blog");
};

0 comments on commit 3ed0c6e

Please sign in to comment.