Requirements
- Node.js 22.12 or newer
- npm, pnpm or yarn
Installation
npm install
npm run dev # http://localhost:4321
npm run build # type-check + static build into ./dist
npm run preview
Project structure
src/
├─ components/ Header, Footer, cards, homepage blocks, widgets
├─ content/
│ ├─ blog/ Articles (.md / .mdx)
│ └─ page/ Static pages (Privacy, Terms, this page)
├─ data/
│ ├─ site.ts Site name, socials, sports (categories) & navigation
│ ├─ authors.ts Writer profiles
│ └─ sports.ts Scoreboard, league tables, fixtures, leaders, videos, poll
├─ layouts/MainLayout.astro
├─ lib/posts.ts Collection helpers
├─ pages/ Routes
└─ styles/style.css Colours, fonts & component classes
Branding
- Logo: replace
public/img/logo.png(white wordmark, used in dark mode and on dark bars) andpublic/img/logo-light.png(dark wordmark for light mode). - Name, tagline, socials:
src/data/site.ts. - Colours: CSS variables at the top of
src/styles/style.css.--sp-brandis the red,--sp-pitchthe green accent. Light values live in:root, dark values in.dark. - Fonts: Barlow Condensed and Barlow, loaded with the Astro Fonts API in
astro.config.mjs.
Writing articles
---
title: "Harbor City Snatch Derby Win in Stoppage Time"
cover: "/img/covers/blog27.jpg"
date: "2026-11-23"
category: "football" # must match a slug in site.ts
tags: [Football, Derby]
readTime: 6
featured: true # appears in the hero & "Most read"
gallery: false # true = photo feature, shown first in "In Pictures"
authorId: "marco-alvarez"
excerpt: "One or two sentences for cards and search."
match: # optional — adds a scoreboard to the article
home: "Harbor City"
away: "Northgate United"
homeScore: 2
awayScore: 1
competition: "Continental League"
status: "FT"
---
Sports data
The Match Center, top scorers, Player of the week, Highlights and Fan poll read from src/data/sports.ts.
All teams and players in the demo are fictional. Replace the arrays with your own data, or fetch them from a sports data API inside the file at build time.
Highlight videos
Each entry in videos (in src/data/sports.ts) has a video URL — YouTube, Vimeo or an .mp4 file — which opens in a GLightbox popup when the play button is clicked, and an href to the related article, used by the title link.
Homepage blocks
| Component | Layout |
|---|---|
BreakingBar |
Red marquee with latest headlines |
HeroCover |
Magazine-cover lead + numbered headlines |
SportsRail |
Sport tiles with story counts |
BlockSplit |
Overlay lead + 2×2 grid |
MatchCenter |
League tabs: table, fixtures, top scorers |
VideoHighlights |
Dark band with featured video + playlist |
AthleteSpotlight |
Player of the week with stat bars |
BlockGrid |
2, 3 or 4 column grid |
RaceStrip |
Red band with horizontal scroller |
OpinionColumns |
Columnist cards |
BlockDuo |
Two sports side by side |
BlockMini |
Lead card + compact list (three side by side) |
PhotoMosaic |
10-tile photo grid — gallery: true posts first |
ArticleListSection |
Paginated latest feed |
Deployment
The output is fully static. Deploy dist/ to Netlify, Vercel, Cloudflare Pages, GitHub Pages or any web host.