fix(website): SEO canonicals, host redirects, sitemap, app noindex
Addresses the high-volume issues from the Ahrefs audit: - Worker entrypoint 301s every request not on https://paseo.sh (www subdomain and http variants), killing the duplicate-page errors and the HTTP→HTTPS internal-link notices. - pageMeta() emits <link rel="canonical"> and og:url per route; every head() call now passes its canonical path. - /blog stops rewriting itself to /blog?drafts=false; the search param only appears when explicitly true. - Sitemap includes /blog and each post. - Trim homepage title under SERP truncation, rewrite /agents meta description under 160 chars, pad short descriptions on /privacy, /download, /cloud, /changelog, /docs. - app.paseo.sh gets <meta robots=noindex,nofollow> and a Disallow-all robots.txt so the SPA shell stops polluting the crawl with H1-missing / no-OG / low-word-count warnings.
This commit is contained in:
@@ -53,6 +53,17 @@ function discoverAgentRoutes(): string[] {
|
||||
.map((slug) => `/${slug}`);
|
||||
}
|
||||
|
||||
function discoverBlogRoutes(): string[] {
|
||||
const postsDir = path.join(__dirname, "posts");
|
||||
if (!fs.existsSync(postsDir)) return ["/blog"];
|
||||
const slugs = fs
|
||||
.readdirSync(postsDir, { withFileTypes: true })
|
||||
.filter((entry) => entry.isFile() && entry.name.endsWith(".md"))
|
||||
.map((entry) => entry.name.replace(/\.md$/, ""))
|
||||
.sort();
|
||||
return ["/blog", ...slugs.map((slug) => `/blog/${slug}`)];
|
||||
}
|
||||
|
||||
const sitemapPages = [
|
||||
"/",
|
||||
"/agents",
|
||||
@@ -62,6 +73,7 @@ const sitemapPages = [
|
||||
"/privacy",
|
||||
...discoverAgentRoutes(),
|
||||
...discoverDocsRoutes(),
|
||||
...discoverBlogRoutes(),
|
||||
].map((routePath) => ({
|
||||
path: routePath,
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user