site: use trailing slash for urls

This commit is contained in:
Glen Huang
2025-10-06 19:51:18 +08:00
committed by Johannes Kirschbauer
parent d92623f07e
commit 25db58ce11
5 changed files with 27 additions and 25 deletions

View File

@@ -0,0 +1,2 @@
export const prerender = true;
export const trailingSlash = "always";

View File

@@ -9,7 +9,7 @@ const articles = import.meta.glob<{
}>("../**/*.md");
export async function load({ params }) {
const article = articles[`../${params.path}.md`];
const article = articles[`../${params.path.slice(0, -"/".length)}.md`];
if (!article) {
error(404, "");
}