How satnaing/astro-paper works
Project type and purpose
• Type: Static site generator / frontend‐only blog theme
• Purpose: Provide a minimal, responsive, SEO‐friendly blog framework (Astro + TypeScript + TailwindCSS), generate dynamic OG images at build time, support search (FuseJS/Pagefind), and deliver via CDN/Cloudflare Pages.
File structure
• src/:
• pages/: Astro & MD pages → routes
• layouts/ & components/: UI building blocks (Header, Footer, PostDetails, etc.)
• data/blog/: Markdown blog content, drafts, release notes
• utils/: helper scripts (OG image generation, slugify, search index)
• config.ts, constants.ts, content.config.ts: global config
• Root config: astro.config.ts, package.json, docker-compose.yml, GitHub Actions workflow (.github/workflows/ci.yml).
Readme insights
• Tech stack: Astro, TypeScript, TailwindCSS, FuseJS (static search), Pagefind, ESLint, Prettier
• Build & deploy:
• Local dev: pnpm run dev or Docker (docker-compose up)
• CI: GitHub Actions runs lint, build, sync
• Production: Deploy to Cloudflare Pages or any static‐hosting CDN
Main components & interactions
a. Developer workstation
• Writes code & content → pushes to GitHub
• Runs local dev server (pnpm/Docker)
b. Source Code Repository (GitHub)
• Hosts code, content, CI workflows
c. CI/CD Pipeline (GitHub Actions)
• On push: installs dependencies → lint/format checks → builds static site → runs tests (if any) → emits production dist/
d. Containerization (Docker/Docker Compose)
• Optional dev/prod containers for consistent environment
e. Static Site Generator (Astro Engine)
• Reads src/pages, data/blog, assets
• Applies layouts & components
• Generates HTML/CSS/JS + dynamic OG images via generateOgImages.ts
• Emits search index files under public/pagefind
f. Deployment & Hosting
• Deploy build output (dist/) to Cloudflare Pages (or any CDN)
• CDN caches assets globally, serves static files
g. End User (Browser)
• Requests pages → receives pre‐rendered HTML, CSS, JS
• Client‐side behavior: theme toggle, fuzzy search, navigation
Architectural patterns & design principles
• Static Site Generation (SSG): all pages are prebuilt
• Componentized UI: Astro components + Tailwind utility classes
• Separation of concerns:
• Content (Markdown) vs. Layout/Presentation
• Build scripts (utils) vs. Runtime code (toggle- theme.js)
• Infrastructure as code: Dockerfile + docker-compose + GitHub Actions