Skip to content

Commit 8d28bf1

Browse files
jebin2claude
andcommitted
fix: use trailing-slash /writing/ URLs to avoid a redirect hop
/writing is a directory, so GitHub Pages 301s it to /writing/. Canonical tags, sitemap entries and every internal post link pointed at the non-slash form, sending crawlers and readers through a redirect on the way to the main content. Use /writing/ consistently in the listing links, setPageMeta calls, sitemap generator and the canonical/og:url tags. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 053dac2 commit 8d28bf1

5 files changed

Lines changed: 17 additions & 17 deletions

File tree

‎js/blog.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ async function init() {
2424
Listing view (/blog/)
2525
============================================ */
2626
async function initListingView() {
27-
setPageMeta({ title: 'Writing | jebin2', path: '/writing' });
27+
setPageMeta({ title: 'Writing | jebin2', path: '/writing/' });
2828
const config = await initPage('blog', { skipTrackPageView: true });
2929
trackPageView('writing');
3030

@@ -74,7 +74,7 @@ async function initPostView(postPath) {
7474
setPageMeta({
7575
title: meta ? `${meta.title} | jebin2` : 'Writing | jebin2',
7676
description: meta?.description,
77-
path: `/writing?post=${encodeURIComponent(postPath)}`,
77+
path: `/writing/?post=${encodeURIComponent(postPath)}`,
7878
type: 'article',
7979
});
8080
trackPageView(meta?.title || 'writing');

‎js/utils.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,12 @@ export function renderPostListing(posts, container, readsMap = {}, dailyReadsMap
149149
return `
150150
<li>
151151
<article id="${escapeHTML(articleId)}">
152-
<a href="/writing?post=${slug}"><h2>${title}${dailyLabel}</h2></a>
152+
<a href="/writing/?post=${slug}"><h2>${title}${dailyLabel}</h2></a>
153153
${newLabel}
154154
<time datetime="${escapeHTML(datetimeStr)}">${escapeHTML(formattedDate)}</time>
155155
<p>${escapeHTML(p.description || '')}</p>
156156
<footer>
157-
<a href="/writing?post=${slug}">Read more about ${title}</a>
157+
<a href="/writing/?post=${slug}">Read more about ${title}</a>
158158
</footer>
159159
</article>
160160
</li>

‎scripts/generate-sitemap.mjs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const SITE = 'https://www.voidall.com';
2020
const STATIC_PAGES = [
2121
{ loc: '/', file: 'index.html', changefreq: 'weekly', priority: '1.0' },
2222
{ loc: '/projects', file: 'projects.html', changefreq: 'weekly', priority: '0.9' },
23-
{ loc: '/writing', file: 'writing/index.html', changefreq: 'weekly', priority: '0.8' },
23+
{ loc: '/writing/', file: 'writing/index.html', changefreq: 'weekly', priority: '0.8' },
2424
{ loc: '/linksilike', file: 'linksilike.html', changefreq: 'monthly', priority: '0.7' },
2525
];
2626

@@ -99,7 +99,7 @@ async function main() {
9999
priority: p.priority,
100100
})),
101101
...posts.map(p => ({
102-
loc: `${SITE}/writing?post=${encodeURIComponent(p.path)}`,
102+
loc: `${SITE}/writing/?post=${encodeURIComponent(p.path)}`,
103103
lastmod: manifestDate(p.last_modified_date || p.created_date),
104104
changefreq: 'monthly',
105105
priority: '0.6',

‎sitemap.xml‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<priority>0.9</priority>
1414
</url>
1515
<url>
16-
<loc>https://www.voidall.com/writing</loc>
16+
<loc>https://www.voidall.com/writing/</loc>
1717
<lastmod>2026-08-10</lastmod>
1818
<changefreq>weekly</changefreq>
1919
<priority>0.8</priority>
@@ -25,49 +25,49 @@
2525
<priority>0.7</priority>
2626
</url>
2727
<url>
28-
<loc>https://www.voidall.com/writing?post=AI%2FHow%20I%20Built%20an%20Unlimited-Access%20AI%20Chatbot%20API%20on%20a%20Free%20VPS%2FHow%20I%20Built%20an%20Unlimited-Access%20AI%20Chatbot%20API%20on%20a%20Free%20VPS.md</loc>
28+
<loc>https://www.voidall.com/writing/?post=AI%2FHow%20I%20Built%20an%20Unlimited-Access%20AI%20Chatbot%20API%20on%20a%20Free%20VPS%2FHow%20I%20Built%20an%20Unlimited-Access%20AI%20Chatbot%20API%20on%20a%20Free%20VPS.md</loc>
2929
<lastmod>2026-05-31</lastmod>
3030
<changefreq>monthly</changefreq>
3131
<priority>0.6</priority>
3232
</url>
3333
<url>
34-
<loc>https://www.voidall.com/writing?post=AI%2FDrop%20a%20Video%20File%2C%20Get%20a%20YouTube-Ready%20Recap%20-%20My%20Fully%20Automated%20Python%20Pipeline%2FDrop%20a%20Video%20File%2C%20Get%20a%20YouTube-Ready%20Recap%20-%20My%20Fully%20Automated%20Python%20Pipeline.md</loc>
34+
<loc>https://www.voidall.com/writing/?post=AI%2FDrop%20a%20Video%20File%2C%20Get%20a%20YouTube-Ready%20Recap%20-%20My%20Fully%20Automated%20Python%20Pipeline%2FDrop%20a%20Video%20File%2C%20Get%20a%20YouTube-Ready%20Recap%20-%20My%20Fully%20Automated%20Python%20Pipeline.md</loc>
3535
<lastmod>2026-05-05</lastmod>
3636
<changefreq>monthly</changefreq>
3737
<priority>0.6</priority>
3838
</url>
3939
<url>
40-
<loc>https://www.voidall.com/writing?post=C%2FLinked%20List%20in%20C%2FLinked%20List%20in%20C.md</loc>
40+
<loc>https://www.voidall.com/writing/?post=C%2FLinked%20List%20in%20C%2FLinked%20List%20in%20C.md</loc>
4141
<lastmod>2026-04-09</lastmod>
4242
<changefreq>monthly</changefreq>
4343
<priority>0.6</priority>
4444
</url>
4545
<url>
46-
<loc>https://www.voidall.com/writing?post=C%2FBitfields%2FBitfields.md</loc>
46+
<loc>https://www.voidall.com/writing/?post=C%2FBitfields%2FBitfields.md</loc>
4747
<lastmod>2026-04-09</lastmod>
4848
<changefreq>monthly</changefreq>
4949
<priority>0.6</priority>
5050
</url>
5151
<url>
52-
<loc>https://www.voidall.com/writing?post=C%2FPointer%20Arithmetic%2FPointer%20Arithmetic.md</loc>
52+
<loc>https://www.voidall.com/writing/?post=C%2FPointer%20Arithmetic%2FPointer%20Arithmetic.md</loc>
5353
<lastmod>2026-04-09</lastmod>
5454
<changefreq>monthly</changefreq>
5555
<priority>0.6</priority>
5656
</url>
5757
<url>
58-
<loc>https://www.voidall.com/writing?post=C%2FPointer%20To%20Pointer%2FPointer%20To%20Pointer.md</loc>
58+
<loc>https://www.voidall.com/writing/?post=C%2FPointer%20To%20Pointer%2FPointer%20To%20Pointer.md</loc>
5959
<lastmod>2026-04-09</lastmod>
6060
<changefreq>monthly</changefreq>
6161
<priority>0.6</priority>
6262
</url>
6363
<url>
64-
<loc>https://www.voidall.com/writing?post=C%2Fpointers%2Fpointers.md</loc>
64+
<loc>https://www.voidall.com/writing/?post=C%2Fpointers%2Fpointers.md</loc>
6565
<lastmod>2026-04-09</lastmod>
6666
<changefreq>monthly</changefreq>
6767
<priority>0.6</priority>
6868
</url>
6969
<url>
70-
<loc>https://www.voidall.com/writing?post=C%2FFloating%20Point%20Standard%2FFloating%20Point%20Standard.md</loc>
70+
<loc>https://www.voidall.com/writing/?post=C%2FFloating%20Point%20Standard%2FFloating%20Point%20Standard.md</loc>
7171
<lastmod>2026-04-09</lastmod>
7272
<changefreq>monthly</changefreq>
7373
<priority>0.6</priority>

‎writing/index.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
<meta name="title" content="jebin2 — writing">
88
<meta name="author" content="jebin2">
99
<meta name="description" content="notes on things i build and learn.">
10-
<link rel="canonical" href="https://www.voidall.com/writing">
10+
<link rel="canonical" href="https://www.voidall.com/writing/">
1111

1212
<!-- Defaults for the listing view; blog.js overwrites these per post -->
1313
<meta property="og:type" content="website">
1414
<meta property="og:site_name" content="jebin2">
15-
<meta property="og:url" content="https://www.voidall.com/writing">
15+
<meta property="og:url" content="https://www.voidall.com/writing/">
1616
<meta property="og:title" content="Writing | jebin2">
1717
<meta property="og:description" content="notes on things i build and learn.">
1818
<meta property="og:image" content="https://www.voidall.com/assets/icons/android-chrome-512x512.png">

0 commit comments

Comments
 (0)