Skip to content

Commit 003bd7e

Browse files
ryclaude
andcommitted
Fix major 404 errors: add robots.txt, favicon, RSS and URL redirects
- Add robots.txt for proper crawling - Add favicon.ico using avatar image - Redirect /feed.xml to /feed to maintain RSS compatibility - Redirect /optimistic_nihilism to /optimistic-nihilism/ 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent f82de0f commit 003bd7e

File tree

5 files changed

+64
-0
lines changed

5 files changed

+64
-0
lines changed

favicon.ico

27.1 KB
Binary file not shown.

feed.page.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
export const url = "/feed";
2+
3+
export default function ({ search }: { search: any }) {
4+
// Generate RSS content for /feed to match original tinyclouds.org
5+
const posts = search.pages()
6+
.filter((page: any) => page.title && page.publish_date)
7+
.sort((a: any, b: any) =>
8+
new Date(b.publish_date).getTime() - new Date(a.publish_date).getTime()
9+
);
10+
11+
const rssItems = posts.map((post: any) => {
12+
const url = `https://tinyclouds${post.url}`;
13+
const date = new Date(post.publish_date).toUTCString();
14+
15+
return ` <item>
16+
<title>${post.title}</title>
17+
<link>${url}</link>
18+
<guid>${url}</guid>
19+
<pubDate>${date}</pubDate>
20+
</item>`;
21+
}).join("\n");
22+
23+
return `<?xml version="1.0" encoding="UTF-8"?>
24+
<rss version="2.0">
25+
<channel>
26+
<title>Ryan Dahl</title>
27+
<description>Personal blog of Ryan Dahl</description>
28+
<link>https://tinyclouds.ry.deno.net</link>
29+
<language>en</language>
30+
<generator>Lume v3.0.5</generator>
31+
${rssItems}
32+
</channel>
33+
</rss>`;
34+
}

feed.xml.page.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export const url = "/feed.xml";
2+
3+
export default function() {
4+
return `<!DOCTYPE html>
5+
<html>
6+
<head>
7+
<meta http-equiv="refresh" content="0; url=/feed">
8+
</head>
9+
<body>
10+
<p>Redirecting to <a href="/feed">/feed</a>...</p>
11+
</body>
12+
</html>`;
13+
}

optimistic_nihilism.page.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export const url = "/optimistic_nihilism";
2+
3+
export default function() {
4+
return `<!DOCTYPE html>
5+
<html>
6+
<head>
7+
<meta http-equiv="refresh" content="0; url=/optimistic-nihilism/">
8+
</head>
9+
<body>
10+
<p>Redirecting to <a href="/optimistic-nihilism/">/optimistic-nihilism/</a>...</p>
11+
</body>
12+
</html>`;
13+
}

robots.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
User-agent: *
2+
Allow: /
3+
4+
Sitemap: https://tinyclouds.ry.deno.net/sitemap.xml

0 commit comments

Comments
 (0)