Skip to main content

Overview

The v3 website is a full Astro application. The project uses Astro v6 for routing, layouts, content, and builds; Svelte 5 islands for interactive UI; MDX content collections for blog posts; and the @astrojs/cloudflare adapter for Cloudflare Workers deployment. Pages live under src/pages/, shared UI lives under src/layouts/ and src/components/, blog content lives under src/content/, and security headers are applied through Astro middleware in src/middleware.ts.

Tech Stack

Framework

Astro v6 with file-based routing and island architecture.

Interactive UI

Svelte v5 islands for search, cookie notice, and text-to-speech.

Content

MDX via @astrojs/mdx, backed by Astro content collections.

Deployment

Cloudflare Workers via @astrojs/cloudflare and Wrangler 4.

Assets

Workers Assets serving the generated dist/ directory.

Feeds

RSS at /rss.xml via @astrojs/rss; sitemap via @astrojs/sitemap.

Icons

Lucide icons through @lucide/astro and @lucide/svelte.

Fonts

Poppins and Fira Code from @fontsource, self-hosted with no external font requests.

Project Structure

Routing

Astro owns routing through src/pages/. The Cloudflare Worker produced by the adapter serves the built site from dist/ through Workers Assets.

Primary Pages

Blog Posts

Blog posts are authored as MDX files in src/content/blog/, validated through the content collection schema in src/content.config.ts, and rendered by src/pages/blog/[...slug].astro.

Shortcuts & Redirects

Redirects are configured in astro.config.mjs.

Content Components

The MDX blog can embed reusable Astro components from src/components/blog/:

Interactive Islands

Astro renders the site statically by default and hydrates only the components that need client-side behavior:
  • BlogSearch.svelte powers client-side blog search on the blog index.
  • TextToSpeech.svelte adds a Web Speech API audio player to blog posts, including a seekable progress bar, voice selection modal, and floating player UI.
  • CookieNotice.svelte displays the site notice as a Svelte island.

Generated Files

  • /rss.xml is generated by @astrojs/rss.
  • The sitemap is generated by @astrojs/sitemap.
  • /llms.txt provides an LLM-readable site description.
  • Fira Code is self-hosted for code blocks through @fontsource.

Security

Security is enforced in src/middleware.ts. The middleware applies strict response headers to every response: Only GET and HEAD HTTP methods are accepted; all others return 405 Method Not Allowed.

Development

Prerequisites

  • Node.js v18 or higher
  • pnpm v9 or higher
  • A Cloudflare account with Wrangler authenticated (wrangler login) for deployment

Local Setup

1

Clone

Clone the repository to your local machine:
2

Install

Install dependencies:
3

Run

Start the Astro development server:
This starts the local Astro dev server at http://localhost:4321 with hot module reloading.

Available Scripts

Deployment

Ensure Wrangler is installed and authenticated (wrangler login), then run:
This generates the version stamp, runs astro build to produce dist/, then deploys via wrangler deploy to the hapara-fail Worker defined in wrangler.jsonc. Assets are served from dist/ through the Workers Assets binding.