How markhorn-dev/astro-nano works
Purpose and runtime
Astro Nano is a static portfolio and blog theme: Astro renders pages at build time, with TypeScript and Tailwind styling and no client UI framework. It is deployable to static-friendly hosts such as Vercel or Netlify. Core build configuration is in astro.config.mjs, package.json, and tailwind.config.mjs.
Route entry points
Filesystem routes under src/pages define the public site:
• Home: src/pages/index.astro
• Blog listing/detail: src/pages/blog/index.astro, src/pages/blog/[...slug].astro
• Projects listing/detail: src/pages/projects/index.astro, src/pages/projects/[...slug].astro
• Work listing: src/pages/work/index.astro
• Generated crawler/feed endpoints: src/pages/robots.txt.ts, src/pages/rss.xml.ts
Catch-all detail routes resolve content-driven slugs rather than requiring a page per post or project.
Content model and publishing boundary
Content is local, versioned Markdown/MDX organized into Astro content collections. src/content/config.ts is the schema/configuration boundary; collection source directories are src/content/blog, src/content/projects, and src/content/work.
Blog supports both Markdown and MDX, including Astro components embedded in MDX (src/content/blog/06-mdx-syntax/index.mdx, src/content/blog/06-mdx-syntax/component.astro). Content metadata and shared TypeScript definitions likely drive filtering, ordering, draft behavior, and route generation (src/consts.ts, src/types.ts).
Page composition and shared shell
src/layouts/PageLayout.astro supplies the common page-level structure. Reusable site chrome and document metadata are separated into components: src/components/Head.astro, src/components/Header.astro, and src/components/Footer.astro. This creates a boundary between route/content-specific rendering and global SEO, navigation, theme, and footer behavior.
Content and navigation presentation uses reusable components such as src/components/Container.astro, src/components/ArrowCard.astro, and src/components/Link.astro, keeping collection pages and content routes visually consistent.
Rendering and data flow
At build time, Astro reads collection files, validates them through src/content/config.ts, and renders:
1. collection content into listing routes;
2. slug-addressable entries into dynamic detail routes;
3. site metadata/content into RSS and robots endpoints.
MDX is compiled with Astro rather than fetched or rendered by a CMS at runtime. The output is a static site in the Astro production build directory, with route behavior established by the page files.
Styling and assets
Global visual rules are centralized in src/styles/global.css, while Tailwind is configured in tailwind.config.mjs. Static assets, notably fonts, are served from public/fonts. Component-scoped Astro markup plus global/Tailwind styles provide responsive, light/dark, and animated presentation without a JavaScript application runtime.
Infrastructure and integration surface
The primary external integration is the Astro build/deployment pipeline; no database, authentication provider, API backend, or CMS is represented in the repository tree. Astro’s configured integrations are the authoritative source for sitemap/feed-related build behavior (astro.config.mjs), while src/pages/rss.xml.ts explicitly exposes the RSS endpoint.
Main entry points: astro.config.mjs Astro build · PageLayout.astro Page layout · [...slug].astro Blog listing and detail · config.ts Collection schema
Components 18
Content
Versioned collections define published entries.
- Collection schema · Validates collection entries and metadata.
src/content/config.ts - Blog collection · Includes MDX with embedded Astro components.
src/content/blog - Projects collection
src/content/projects - Work collection
src/content/work - Content metadata · Supports filtering, ordering, drafts, and route generation.
src/consts.ts
Public routes
Filesystem pages and generated endpoints.
- Home
src/pages/index.astro - Blog listing and detail · Catch-all detail route resolves entry slugs.
src/pages/blog/[...slug].astro - Projects listing and detail · Catch-all detail route resolves entry slugs.
src/pages/projects/[...slug].astro - Work listing
src/pages/work/index.astro - RSS feed
src/pages/rss.xml.ts - Robots endpoint
src/pages/robots.txt.ts
Shared presentation
Common shell and reusable visual components.
- Page layout · Provides the common page-level structure.
src/layouts/PageLayout.astro - Site chrome and metadata · Head, header, and footer separate global concerns.
src/components/Head.astro - Content presentation · Shared container, cards, and links keep routes consistent.
src/components/Container.astro - Styling system · Global rules and utility configuration provide responsive theme styling.
src/styles/global.css
Build and delivery
Astro compiles the static site for hosting.
- Astro build · Compiles routes, collections, MDX, and integrations at build time.
astro.config.mjs - Static site output · Served by static-friendly hosts such as Vercel or Netlify.
- Public fonts
public/fonts
Connections 23
- Collection schema → Blog collection: validates
- Collection schema → Projects collection: validates
- Collection schema → Work collection: validates
- Content metadata → Blog listing and detail: drives publishing rules
- Blog collection → Blog listing and detail: renders listings and slugs
- Projects collection → Projects listing and detail: renders listings and slugs
- Work collection → Work listing: renders listing
- Blog collection → RSS feed: supplies feed entries
- Page layout → Home: wraps
- Page layout → Blog listing and detail: wraps
- Page layout → Projects listing and detail: wraps
- Page layout → Work listing: wraps
- Site chrome and metadata → Page layout: composes
- Content presentation → Page layout: supports content views
- Styling system → Page layout: styles
- Public fonts → Astro build: included in build
- Home → Astro build: compiled
- Blog listing and detail → Astro build: compiled
- Projects listing and detail → Astro build: compiled
- Work listing → Astro build: compiled
- RSS feed → Astro build: generated
- Robots endpoint → Astro build: generated
- Astro build → Static site output: emits