source for getorbyt.com getorbyt.com/
client bsky orbytapp app orbyt bluesky getorbyt orbytvideo atproto video
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Replace @astrojs/sitemap with prerendered sitemap endpoint

- Remove @astrojs/sitemap integration
- Add prerendered sitemap.xml.ts endpoint (generates static sitemap at build time)
- Update robots.txt to reference sitemap.xml
- Follows sitemaps.org protocol and Cloudflare best practices
- Auto-updates lastmod date on each build

Co-authored-by: Cursor <cursoragent@cursor.com>

+28 -104
-2
astro.config.mjs
··· 1 1 import { defineConfig } from 'astro/config'; 2 2 import cloudflare from '@astrojs/cloudflare'; 3 - import sitemap from '@astrojs/sitemap'; 4 3 5 4 export default defineConfig({ 6 5 site: 'https://getorbyt.com', ··· 18 17 }, 19 18 }, 20 19 }), 21 - integrations: [sitemap()], 22 20 });
+2 -69
package-lock.json
··· 10 10 "license": "ISC", 11 11 "dependencies": { 12 12 "@astrojs/cloudflare": "^12.6.12", 13 - "@astrojs/sitemap": "^3.7.0", 14 13 "astro": "^5.16.8" 15 14 } 16 15 }, ··· 82 81 }, 83 82 "engines": { 84 83 "node": "18.20.8 || ^20.3.0 || >=22.0.0" 85 - } 86 - }, 87 - "node_modules/@astrojs/sitemap": { 88 - "version": "3.7.0", 89 - "resolved": "https://registry.npmjs.org/@astrojs/sitemap/-/sitemap-3.7.0.tgz", 90 - "integrity": "sha512-+qxjUrz6Jcgh+D5VE1gKUJTA3pSthuPHe6Ao5JCxok794Lewx8hBFaWHtOnN0ntb2lfOf7gvOi9TefUswQ/ZVA==", 91 - "license": "MIT", 92 - "dependencies": { 93 - "sitemap": "^8.0.2", 94 - "stream-replace-string": "^2.0.0", 95 - "zod": "^3.25.76" 96 84 } 97 85 }, 98 86 "node_modules/@astrojs/telemetry": { ··· 1747 1735 "@types/unist": "*" 1748 1736 } 1749 1737 }, 1750 - "node_modules/@types/node": { 1751 - "version": "25.2.2", 1752 - "resolved": "https://registry.npmjs.org/@types/node/-/node-25.2.2.tgz", 1753 - "integrity": "sha512-BkmoP5/FhRYek5izySdkOneRyXYN35I860MFAGupTdebyE66uZaR+bXLHq8k4DirE5DwQi3NuhvRU1jqTVwUrQ==", 1754 - "license": "MIT", 1755 - "peer": true, 1756 - "dependencies": { 1757 - "undici-types": "~7.16.0" 1758 - } 1759 - }, 1760 - "node_modules/@types/sax": { 1761 - "version": "1.2.7", 1762 - "resolved": "https://registry.npmjs.org/@types/sax/-/sax-1.2.7.tgz", 1763 - "integrity": "sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==", 1764 - "license": "MIT", 1765 - "dependencies": { 1766 - "@types/node": "*" 1767 - } 1768 - }, 1769 1738 "node_modules/@types/unist": { 1770 1739 "version": "3.0.3", 1771 1740 "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", ··· 1897 1866 "funding": { 1898 1867 "url": "https://github.com/sponsors/jonschlinkert" 1899 1868 } 1900 - }, 1901 - "node_modules/arg": { 1902 - "version": "5.0.2", 1903 - "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", 1904 - "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", 1905 - "license": "MIT" 1906 1869 }, 1907 1870 "node_modules/argparse": { 1908 1871 "version": "2.0.1", ··· 5071 5034 "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", 5072 5035 "license": "MIT" 5073 5036 }, 5074 - "node_modules/sitemap": { 5075 - "version": "8.0.2", 5076 - "resolved": "https://registry.npmjs.org/sitemap/-/sitemap-8.0.2.tgz", 5077 - "integrity": "sha512-LwktpJcyZDoa0IL6KT++lQ53pbSrx2c9ge41/SeLTyqy2XUNA6uR4+P9u5IVo5lPeL2arAcOKn1aZAxoYbCKlQ==", 5078 - "license": "MIT", 5079 - "dependencies": { 5080 - "@types/node": "^17.0.5", 5081 - "@types/sax": "^1.2.1", 5082 - "arg": "^5.0.0", 5083 - "sax": "^1.4.1" 5084 - }, 5085 - "bin": { 5086 - "sitemap": "dist/cli.js" 5087 - }, 5088 - "engines": { 5089 - "node": ">=14.0.0", 5090 - "npm": ">=6.0.0" 5091 - } 5092 - }, 5093 - "node_modules/sitemap/node_modules/@types/node": { 5094 - "version": "17.0.45", 5095 - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz", 5096 - "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==", 5097 - "license": "MIT" 5098 - }, 5099 5037 "node_modules/smol-toml": { 5100 5038 "version": "1.6.0", 5101 5039 "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.6.0.tgz", ··· 5136 5074 "node": ">=4", 5137 5075 "npm": ">=6" 5138 5076 } 5139 - }, 5140 - "node_modules/stream-replace-string": { 5141 - "version": "2.0.0", 5142 - "resolved": "https://registry.npmjs.org/stream-replace-string/-/stream-replace-string-2.0.0.tgz", 5143 - "integrity": "sha512-TlnjJ1C0QrmxRNrON00JvaFFlNh5TTG00APw23j74ET7gkQpTASi6/L2fuiav8pzK715HXtUeClpBTw2NPSn6w==", 5144 - "license": "MIT" 5145 5077 }, 5146 5078 "node_modules/string-width": { 5147 5079 "version": "7.2.0", ··· 5361 5293 "version": "7.16.0", 5362 5294 "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", 5363 5295 "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", 5364 - "license": "MIT" 5296 + "license": "MIT", 5297 + "optional": true 5365 5298 }, 5366 5299 "node_modules/unenv": { 5367 5300 "version": "2.0.0-rc.24",
-1
package.json
··· 25 25 "homepage": "https://github.com/Hann8n/orbyt-site#readme", 26 26 "dependencies": { 27 27 "@astrojs/cloudflare": "^12.6.12", 28 - "@astrojs/sitemap": "^3.7.0", 29 28 "astro": "^5.16.8" 30 29 } 31 30 }
+1 -1
public/robots.txt
··· 8 8 # Block OAuth callback page (not meant for indexing) 9 9 Disallow: /callback.html 10 10 11 - # Sitemap location 11 + # Sitemap location (sitemaps.org protocol) 12 12 Sitemap: https://getorbyt.com/sitemap.xml
+25 -31
src/pages/sitemap.xml.ts
··· 1 1 import type { APIRoute } from 'astro'; 2 2 3 - /** 4 - * Custom sitemap.xml endpoint 5 - * 6 - * This endpoint generates a sitemap index that references the static sitemap 7 - * generated by @astrojs/sitemap. The integration generates sitemap-index.xml 8 - * which contains references to all numbered sitemap files (sitemap-0.xml, etc.). 9 - * 10 - * Note: Dynamic SSR routes (/@[handle] and /@[handle]/[postId]) cannot be 11 - * auto-discovered by @astrojs/sitemap since they're rendered on-demand. 12 - * These routes will be discovered by crawlers through links on your site. 13 - * 14 - * If you need to explicitly include specific handles/posts in the sitemap, 15 - * you can extend this endpoint to fetch them and add additional <sitemap> 16 - * entries pointing to custom sitemap files. 17 - */ 3 + export const prerender = true; 4 + 18 5 export const GET: APIRoute = ({ site }) => { 19 - // Handle site as URL object or string 20 - const siteUrl = site 21 - ? (typeof site === 'string' ? site : site.href).replace(/\/$/, '') 22 - : 'https://getorbyt.com'; 6 + const siteUrl = (typeof site === 'string' ? site : site?.href || 'https://getorbyt.com').replace(/\/$/, ''); 7 + const today = new Date().toISOString().split('T')[0]; 23 8 24 - // Generate sitemap index XML that references the generated sitemap-index.xml 25 - // This allows robots.txt to reference /sitemap.xml while the actual 26 - // sitemap structure is managed by @astrojs/sitemap 27 - const sitemapIndex = `<?xml version="1.0" encoding="UTF-8"?> 28 - <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> 29 - <sitemap> 30 - <loc>${siteUrl}/sitemap-index.xml</loc> 31 - <lastmod>${new Date().toISOString().split('T')[0]}</lastmod> 32 - </sitemap> 33 - </sitemapindex>`; 9 + const pages = [ 10 + { path: '/', changefreq: 'weekly', priority: '1.0' }, 11 + { path: '/app/', changefreq: 'monthly', priority: '0.8' }, 12 + { path: '/beta/', changefreq: 'monthly', priority: '0.8' }, 13 + { path: '/contact/', changefreq: 'monthly', priority: '0.6' }, 14 + { path: '/discord/', changefreq: 'monthly', priority: '0.6' }, 15 + { path: '/privacy/', changefreq: 'yearly', priority: '0.4' }, 16 + { path: '/terms/', changefreq: 'yearly', priority: '0.4' }, 17 + ]; 18 + 19 + const sitemap = `<?xml version="1.0" encoding="UTF-8"?> 20 + <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> 21 + ${pages.map(page => ` <url> 22 + <loc>${siteUrl}${page.path}</loc> 23 + <lastmod>${today}</lastmod> 24 + <changefreq>${page.changefreq}</changefreq> 25 + <priority>${page.priority}</priority> 26 + </url>`).join('\n')} 27 + </urlset>`; 34 28 35 - return new Response(sitemapIndex, { 29 + return new Response(sitemap, { 36 30 headers: { 37 31 'Content-Type': 'application/xml; charset=utf-8', 38 - 'Cache-Control': 'public, max-age=3600', // Cache for 1 hour 32 + 'Cache-Control': 'public, max-age=3600', 39 33 }, 40 34 }); 41 35 };