diff options
| author | netop://ウィビ <paul@webb.page> | 2026-07-22 10:55:23 -0700 |
|---|---|---|
| committer | netop://ウィビ <paul@webb.page> | 2026-07-22 10:55:23 -0700 |
| commit | 55d8b17aeccb48194cbaea9831286b4b73ac7059 (patch) | |
| tree | 99b24d4037863802496745e6c1482e03809a2321 /main.ts | |
| parent | b0e6f006d06553040e7f1d9db81f003607d75d2b (diff) | |
| download | blog-55d8b17aeccb48194cbaea9831286b4b73ac7059.tar.gz blog-55d8b17aeccb48194cbaea9831286b4b73ac7059.zip | |
fixes canonical links
Diffstat (limited to 'main.ts')
| -rw-r--r-- | main.ts | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -156,7 +156,8 @@ const server = Deno.serve({ } if (/^\/(WM-\d*)$/.test(pathname)) { - const slug = pathname.slice(1) + ".txt"; + const rawSlug = pathname.slice(1); + const slug = rawSlug + ".txt"; const posts = await getDocuments(memoDirectory); if (posts && posts.indexOf(slug) < 0) { @@ -172,7 +173,7 @@ const server = Deno.serve({ const listings = await getDirectoryContents(memoDirectory); return new Response( - createLayout("memo", await populateDocument({ filename: slug }), populateRecents(listings, slug)), { + createLayout("memo", await populateDocument({ filename: slug }), populateRecents(listings, slug), rawSlug), { headers: { "content-type": "text/html; charset=utf-8" } @@ -206,7 +207,8 @@ const server = Deno.serve({ } if (/^\/remarks\/(WR-\d*)$/.test(pathname)) { - const slug = pathname.split("/").pop() + ".txt"; + const rawSlug = pathname.split("/").pop(); + const slug = rawSlug + ".txt"; const posts = await getDocuments(remarkDirectory); if (posts && posts.indexOf(slug) < 0) { @@ -222,7 +224,7 @@ const server = Deno.serve({ const listings = await getDirectoryContents(remarkDirectory); return new Response( - createLayout("remark", await populateDocument({ filename: slug }), populateRecents(listings, slug)), { + createLayout("remark", await populateDocument({ filename: slug }), populateRecents(listings, slug), rawSlug), { headers: { "content-type": "text/html; charset=utf-8" } |