How 37ng/37ng.github.io works
Purpose and runtime
This is an Astro-based static personal/blog site centered on an interactive, visual Bitcoin article experience. It combines Astro pages and layouts with React/TSX islands for client-side animation, interaction, and 3D rendering. The deploy pipeline is defined at .github/workflows/deploy.yml; runtime/package choices are in package.json.
HTTP entry points and routing
• Homepage: src/pages/index.astro
• Dynamic blog-post route: src/pages/blog/[slug].astro
• Content originates from MDX files under src/content/blog/, including src/content/blog/bitcoin.mdx and src/content/blog/prologue.mdx.
• src/content.config.ts defines the Astro content collection boundary used to validate and load post metadata/content.
The slug route resolves a requested post from the content collection and renders it through the post layout rather than exposing a separate application API.
Layout and document shell
src/layouts/BaseLayout.astro is the shared document-level shell: it centralizes global page structure and styling concerns. src/layouts/PostLayout.astro composes the article-specific experience around rendered MDX content.
Global visual tokens and site-wide CSS are rooted in src/styles/global.css. The layout boundary keeps static Astro rendering and MDX composition separate from interactive React components.
Content-to-page flow
Blog MDX is the primary data source:
1. Posts are discovered/queried through src/content.config.ts and src/lib/posts.ts.
2. src/pages/blog/[slug].astro maps a slug to its content entry.
3. src/layouts/PostLayout.astro renders the resolved article and embeds relevant visual components.
4. Homepage presentation can use post-derived display data and fan-layout calculations from src/lib/posts.ts and src/lib/fan.ts.
This is a content-driven static-site flow, not a database-backed service.
Interactive presentation islands
React components provide isolated browser-side behavior within Astro-rendered pages:
• src/components/Clock.tsx supplies a live/time-based display.
• src/components/ThemeToggle.tsx manages user theme interaction.
• src/components/PostsFan.tsx presents posts in a fan-like interactive layout.
• src/components/HeroStage.astro and src/components/stages/PaperSheet.astro define higher-level staged visual composition.
Reusable primitives in src/components/ui/Button.tsx, src/components/ui/Panel.tsx, and src/components/ui/Tag.tsx support consistent component-level presentation.
Bitcoin visualization subsystem
The Bitcoin post has a dedicated visualization domain:
• src/components/diagrams/BitcoinTimeline.astro integrates the timeline into Astro/MDX composition.
• src/components/diagrams/BitcoinTimeline.tsx implements the interactive timeline island.
• src/components/diagrams/BitcoinCoin3D.tsx renders the 3D coin visual, backed by the static model public/bitcoin.glb.
Domain data and computation are separated from rendering: src/lib/bitcoin-timeline.ts supplies timeline-oriented data, while src/lib/bitcoin-blocks.ts and src/lib/sha256.ts model block/hash-related logic. The 3D model is served as a public static asset rather than generated server-side.
Build, static assets, and delivery boundaries
Astro configuration is in astro.config.mjs; TypeScript behavior is controlled by tsconfig.json. Static browser assets are served from public/, notably public/bitcoin.glb. Git hooks in .githooks/ enforce local workflow checks, while .github/workflows/deploy.yml is the infrastructure boundary for publishing the built site.
Components 18
Content pipeline
- Blog MDX posts · Article content and metadata.
- Content collection · Defines the validated blog collection.
src/content.config.ts - Post queries · Queries posts and derives display data.
src/lib/posts.ts - Fan layout math
src/lib/fan.ts
Astro site
- Homepage
src/pages/index.astro - Blog slug route · Resolves a post by slug.
src/pages/blog/[slug].astro - Base layout · Shared page structure and global styling boundary.
src/layouts/BaseLayout.astro - Post layout · Composes rendered MDX with article visuals.
src/layouts/PostLayout.astro - Global styles
src/styles/global.css
Interactive visuals
- Hero stage
src/components/HeroStage.astro - Posts fan · Interactive post presentation.
src/components/PostsFan.tsx - Clock and theme · Live display and theme interaction.
- Bitcoin timeline · Interactive timeline embedded in the Bitcoin article.
src/components/diagrams/BitcoinTimeline.astro - Bitcoin domain logic · Provides timeline data and block/hash computation.
src/lib/bitcoin-timeline.ts - 3D Bitcoin coin
src/components/diagrams/BitcoinCoin3D.tsx - Bitcoin GLB model
public/bitcoin.glb
Build and delivery
- Astro build · Builds Astro pages and client islands.
astro.config.mjs - Deployment workflow · Publishes the built static site.
.github/workflows/deploy.yml
Connections 19
- Blog MDX posts → Content collection: validated by
- Content collection → Post queries: queried through
- Post queries → Homepage: supplies post data
- Fan layout math → Posts fan: positions posts
- Post queries → Blog slug route: resolves slug
- Blog slug route → Post layout: renders entry with
- Blog MDX posts → Post layout: article content
- Base layout → Homepage: wraps
- Base layout → Post layout: wraps
- Global styles → Base layout: styles
- Hero stage → Homepage: composes
- Posts fan → Homepage: interactive display
- Bitcoin timeline → Post layout: embedded in Bitcoin post
- Bitcoin domain logic → Bitcoin timeline: supplies timeline data
- 3D Bitcoin coin → Bitcoin timeline: renders visual
- Bitcoin GLB model → 3D Bitcoin coin: loaded by browser
- Astro build → Homepage: builds
- Astro build → Blog slug route: builds static routes
- Deployment workflow → Astro build: runs publishing build