Openstatus www.openstatus.dev

feat(sitemaps): add sitemaps config (#44)

* feat(sitemaps): add initial sitemaps config

* feat: add `/monitor/openstatus/` route

* remove sign up and sign in routes

* feat: add robots.txt file

* remove robots.txt

* add function to generate `robots.txt` file

authored by

Kelvin Amoaba and committed by
GitHub
2126a083 e2ac4240

+39
+11
apps/web/src/app/robots.ts
··· 1 + import type { MetadataRoute } from "next"; 2 + 3 + export default function robots(): MetadataRoute.Robots { 4 + return { 5 + rules: { 6 + userAgent: "*", 7 + allow: "/", 8 + }, 9 + sitemap: "https://www.openstatus.dev/sitemap.xml", 10 + }; 11 + }
+28
apps/web/src/sitemap.ts
··· 1 + import type { MetadataRoute } from "next"; 2 + 3 + const addPathToBaseURL = (path: string) => `https://openstatus.dev${path}`; 4 + 5 + export default function sitemap(): MetadataRoute.Sitemap { 6 + return [ 7 + { 8 + url: addPathToBaseURL("/"), 9 + lastModified: new Date(), 10 + }, 11 + { 12 + url: addPathToBaseURL("/play"), 13 + lastModified: new Date(), 14 + }, 15 + { 16 + url: addPathToBaseURL("/sign-in"), 17 + lastModified: new Date(), 18 + }, 19 + { 20 + url: addPathToBaseURL("/sign-up"), 21 + lastModified: new Date(), 22 + }, 23 + { 24 + url: addPathToBaseURL("/monitor/openstatus"), 25 + lastModified: new Date(), 26 + }, 27 + ]; 28 + }