diff --git a/README.md b/README.md index b653c89..6b86fcd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Copernicus -[![Deploy](https://github.com/activatedgeek/copernicus/actions/workflows/pages.yml/badge.svg)](https://github.com/activatedgeek/copernicus/actions/workflows/pages.yml) +[![Deploy](https://github.com/activatedgeek/copernicus/actions/workflows/pages.yml/badge.svg)](https://github.com/activatedgeek/copernicus/actions/workflows/pages.yml) [![Better Stack Badge](https://uptime.betterstack.com/status-badges/v1/monitor/13rvh.svg)](https://status.sanyamkapoor.com/?utm_source=status_badge) Base framework to generate my website based on [Astro](https://astro.build). Website & knowledge base hosted at [sanyamkapoor.com](https://sanyamkapoor.com). diff --git a/src/pages/redirects.ts b/src/pages/redirects.ts index 7bed393..c0a4295 100644 --- a/src/pages/redirects.ts +++ b/src/pages/redirects.ts @@ -3,7 +3,7 @@ import { getCollection } from "astro:content"; import { processCollectionItem } from "@lib/collections"; -const allRedirects = ( +const kbRedirects = ( await Promise.all((await getCollection("kb")).map(processCollectionItem)) ) .map( @@ -25,12 +25,17 @@ const allRedirects = ( ) .flat(); +const manualRedirects = [["/cv", "/cv.pdf"]]; + +const allRedirects = [...kbRedirects, ...manualRedirects]; + const redirectsTxt = allRedirects .map((r) => [...r, "301"].join(" ")) .join("\n"); export const prerender = true; +// Cloudflare Pages redirects https://developers.cloudflare.com/pages/configuration/redirects/ export const GET: APIRoute = () => { return new Response(redirectsTxt, { headers: {