Skip to content

Commit e4cc94f

Browse files
authored
fix(docs): fix Google indexing by resolving soft 404s and adding SEO files (#102)
1 parent a841938 commit e4cc94f

File tree

4 files changed

+61
-2
lines changed

4 files changed

+61
-2
lines changed

packages/docs/public/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://static.funstack.work/sitemap.xml

packages/docs/public/sitemap.xml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3+
<url>
4+
<loc>https://static.funstack.work/</loc>
5+
</url>
6+
<url>
7+
<loc>https://static.funstack.work/getting-started</loc>
8+
</url>
9+
<url>
10+
<loc>https://static.funstack.work/getting-started/migrating-from-vite-spa</loc>
11+
</url>
12+
<url>
13+
<loc>https://static.funstack.work/faq</loc>
14+
</url>
15+
<url>
16+
<loc>https://static.funstack.work/api/funstack-static</loc>
17+
</url>
18+
<url>
19+
<loc>https://static.funstack.work/api/defer</loc>
20+
</url>
21+
<url>
22+
<loc>https://static.funstack.work/api/entry-definition</loc>
23+
</url>
24+
<url>
25+
<loc>https://static.funstack.work/learn/how-it-works</loc>
26+
</url>
27+
<url>
28+
<loc>https://static.funstack.work/learn/rsc</loc>
29+
</url>
30+
<url>
31+
<loc>https://static.funstack.work/learn/optimizing-payloads</loc>
32+
</url>
33+
<url>
34+
<loc>https://static.funstack.work/learn/lazy-server-components</loc>
35+
</url>
36+
<url>
37+
<loc>https://static.funstack.work/learn/defer-and-activity</loc>
38+
</url>
39+
<url>
40+
<loc>https://static.funstack.work/learn/file-system-routing</loc>
41+
</url>
42+
<url>
43+
<loc>https://static.funstack.work/advanced/multiple-entrypoints</loc>
44+
</url>
45+
<url>
46+
<loc>https://static.funstack.work/advanced/ssr</loc>
47+
</url>
48+
</urlset>

packages/docs/src/entries.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,16 @@ function pathToEntryPath(path: string): string {
2020
}
2121

2222
export default function getEntries(): EntryDefinition[] {
23-
return collectPaths(routes).map((pathname) => ({
23+
const entries = collectPaths(routes).map((pathname) => ({
2424
path: pathToEntryPath(pathname),
2525
root: () => import("./root"),
2626
app: <App ssrPath={pathname} />,
2727
}));
28+
// Generate a 404.html so Cloudflare can serve it with a proper 404 status
29+
entries.push({
30+
path: "404.html",
31+
root: () => import("./root"),
32+
app: <App ssrPath="/404" />,
33+
});
34+
return entries;
2835
}

packages/docs/wrangler.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ compatibility_date = "2026-02-18"
55

66
[assets]
77
directory = "./dist/public"
8-
not_found_handling = "single-page-application"
8+
not_found_handling = "404-page"

0 commit comments

Comments
 (0)