website

Personal website
git clone https://github.com/michaelneuper/website.git
README | Files | Log | Refs

commit 06683f589386b8681992e4a73382a50211b6b7d1
parent 48203d204b42c9f4463b239bf803f728606f37ba
Author: Michael Neuper <michael@michaelneuper.com>
Date:   Mon, 12 Oct 2026 16:58:07 +0200

move headers to _headers file

Diffstat:
A.node-version | 1+
Mnetlify.toml | 23+----------------------
Apublic/_headers | 16++++++++++++++++
Awrangler.jsonc | 11+++++++++++
4 files changed, 29 insertions(+), 22 deletions(-)

diff --git a/.node-version b/.node-version @@ -0,0 +1 @@ +22 diff --git a/netlify.toml b/netlify.toml @@ -6,25 +6,4 @@ publish = "dist" # Astro 7 needs Node 22.12 or newer. NODE_VERSION = "22" -[[headers]] -for = "/*" - [headers.values] - X-Content-Type-Options = "nosniff" - -# Astro puts a content hash in these file names, so browsers can keep them for good. -[[headers]] -for = "/_astro/*" - [headers.values] - Cache-Control = "public, max-age=31536000, immutable" - -# The comments' frame on giscus.app loads its stylesheet and our fonts from here. -# The stylesheets are open to any origin, so `npm run dev` can use them too. -[[headers]] -for = "/giscus/*" - [headers.values] - Access-Control-Allow-Origin = "*" - -[[headers]] -for = "/fonts/*" - [headers.values] - Access-Control-Allow-Origin = "https://giscus.app" +# Response headers are in public/_headers, which Cloudflare reads too. diff --git a/public/_headers b/public/_headers @@ -0,0 +1,16 @@ +# Response headers, read by both Netlify and Cloudflare. + +/* + X-Content-Type-Options: nosniff + +# Astro puts a content hash in these file names, so browsers can keep them for good. +/_astro/* + Cache-Control: public, max-age=31536000, immutable + +# The comments' frame on giscus.app loads its stylesheet and our fonts from here. +# The stylesheets are open to any origin, so `npm run dev` can use them too. +/giscus/* + Access-Control-Allow-Origin: * + +/fonts/* + Access-Control-Allow-Origin: https://giscus.app diff --git a/wrangler.jsonc b/wrangler.jsonc @@ -0,0 +1,11 @@ +// Cloudflare: the site is static, so the Worker only serves dist/. +// Build with `npm run build`, then deploy with `npx wrangler deploy`. +{ + // Must match the Worker's name in the Cloudflare dashboard. + "name": "website", + "compatibility_date": "2026-10-01", + "assets": { + "directory": "./dist", + "not_found_handling": "404-page" + } +}