Technical reference for BCF website development.
Topic guides:
- TypeScript — script rules, patterns, component structure, import paths
- Styling — Tailwind approach, section background rhythm, WaveSeparator
- Alpine.js — interactive components, progressive enhancement
- Content & Images — content collections, image utilities
src/
├── pages/ # File-based routing (Astro creates routes automatically)
├── components/ # Reusable Astro components (Navbar, Footer)
├── layouts/ # Page wrapper components
├── content/ # Content collections (blog, _whitepapers)
├── data/ # Image imports and data utilities
├── utils/ # Helper functions, metadata, content aggregation
├── scripts/ # Client-side JavaScript
├── styles/ # Global CSS with .bcf-* classes
└── assets/ # Optimized images
public/ # Static assets served directly
- Astro v5.15.6 - Static site generator (fully static build, no SSR)
- Tailwind CSS v3.4.17 - Utility-first styling with global
.bcf-*classes - TypeScript - Strict configuration enabled
- Alpine.js - Progressive enhancement for interactive components
npm install # Install dependencies
npm run dev # Start dev server at localhost:4321
npm run build # Build production site to ./dist/
npm run preview # Preview production build locally
npx astro check # Check for TypeScript errorsAutomatically run before build:
generate-content-dates.js- Extract dates from content collectionsupdate-lastmod-from-git.js- Update lastmod dates from Git history
- All pages are pre-rendered at build time
- No server-side rendering (SSR)
- Output directory:
./dist/
All pages use Layout.astro except special cases.
/showcase- No footer, full-height scroll-snap behavior
- Dynamic sizing: 96px at top of page, 80px when scrolled
- Multi-level dropdown navigation
- Mobile-responsive with hamburger menu
- Astro automatically optimises images
- Use
<Image>component fromastro:assets - Provide appropriate
widthandheightattributes - Use
loading="lazy"for below-fold images
- Alpine.js only (~15KB gzipped)
- No heavy frameworks (React, Vue, etc.)
- Vanilla JavaScript for simple interactions
- Tailwind purges unused styles in production
- Global classes reduce duplication
- Scoped styles only for animations
- Run
npx astro checkto verify no TypeScript errors - Check for console errors in browser
- Test on mobile viewport
- Verify all global classes are used appropriately
- Ensure no inline scripts use TypeScript syntax
- Images load correctly with optimisation
- Test keyboard navigation for interactive elements
- Verify proper heading hierarchy (single H1 per page)
- UK English spelling for content only - Use British English (organisation, licence, centre) in user-facing text. Never change code syntax (CSS properties, SVG attributes, Tailwind classes)
- Run
npx astro checkafter any TypeScript or Astro file changes - Only fix errors in files you have modified - Don't attempt to fix all project errors
- Use global
.bcf-*classes before creating custom styling - Mobile-first approach with generous spacing:
px-6 sm:px-8
- Never create scripts to automatically fix TypeScript errors across the entire codebase
- Never use TypeScript syntax in script tags with
define:vars - Never over-automate - Fix errors manually with proper understanding
Metadata (lastmod dates) automatically updated from Git history during builds via pre-build scripts.
- Run
npx astro checkbefore committing - Test changes on multiple viewports
- Verify navigation links work
- Check images load with proper alt text
Astro Documentation:
TypeScript:
Alpine.js:
Tailwind CSS: