# markhorn-dev/astro-nano architecture

> Architecture diagram of the GitHub repository markhorn-dev/astro-nano, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/markhorn-dev/astro-nano
- Repository: https://github.com/markhorn-dev/astro-nano

## Overview

#### 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`](https://github.com/markhorn-dev/astro-nano/blob/main/astro.config.mjs) (Astro build), [`src/layouts/PageLayout.astro`](https://github.com/markhorn-dev/astro-nano/blob/main/src/layouts/PageLayout.astro) (Page layout), [`src/pages/blog/[...slug].astro`](https://github.com/markhorn-dev/astro-nano/blob/main/src/pages/blog/%5B...slug%5D.astro) (Blog listing and detail), [`src/content/config.ts`](https://github.com/markhorn-dev/astro-nano/blob/main/src/content/config.ts) (Collection schema)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_content["Content"]
  node_content_config["Collection schema<br/>Astro content config<br/>[config.ts]"]
  node_blog_content["Blog collection<br/>Markdown and MDX content"]
  node_project_content["Projects collection<br/>Markdown content"]
  node_work_content["Work collection<br/>Markdown content"]
  node_content_defs["Content metadata<br/>TypeScript constants and types<br/>[consts.ts]"]
end

subgraph group_routes["Public routes"]
  node_home["Home<br/>Astro page<br/>[index.astro]"]
  node_blog_routes["Blog listing and detail<br/>Astro routes<br/>[&#91;...slug&#93;.astro]"]
  node_project_routes["Projects listing and detail<br/>Astro routes<br/>[&#91;...slug&#93;.astro]"]
  node_work_route["Work listing<br/>Astro page<br/>[index.astro]"]
  node_feed_endpoint["RSS feed<br/>Generated endpoint<br/>[rss.xml.ts]"]
  node_robots_endpoint["Robots endpoint<br/>Generated endpoint<br/>[robots.txt.ts]"]
end

subgraph group_ui["Shared presentation"]
  node_page_layout["Page layout<br/>Astro layout<br/>[PageLayout.astro]"]
  node_site_chrome["Site chrome and metadata<br/>Astro components<br/>[Head.astro]"]
  node_content_components["Content presentation<br/>Astro components<br/>[Container.astro]"]
  node_styles["Styling system<br/>Global CSS and Tailwind<br/>[global.css]"]
end

subgraph group_build["Build and delivery"]
  node_astro_build{{"Astro build<br/>Static site generator<br/>[astro.config.mjs]"}}
  node_static_output["Static site output<br/>Deployable static files"]
  node_static_assets["Public fonts<br/>Static assets"]
end

node_content_config -->|"validates"| node_blog_content
node_content_config -->|"validates"| node_project_content
node_content_config -->|"validates"| node_work_content
node_content_defs -->|"drives publishing rules"| node_blog_routes
node_blog_content -->|"renders listings and slugs"| node_blog_routes
node_project_content -->|"renders listings and slugs"| node_project_routes
node_work_content -->|"renders listing"| node_work_route
node_blog_content -->|"supplies feed entries"| node_feed_endpoint
node_page_layout -->|"wraps"| node_home
node_page_layout -->|"wraps"| node_blog_routes
node_page_layout -->|"wraps"| node_project_routes
node_page_layout -->|"wraps"| node_work_route
node_site_chrome -->|"composes"| node_page_layout
node_content_components -->|"supports content views"| node_page_layout
node_styles -->|"styles"| node_page_layout
node_static_assets -->|"included in build"| node_astro_build
node_home -->|"compiled"| node_astro_build
node_blog_routes -->|"compiled"| node_astro_build
node_project_routes -->|"compiled"| node_astro_build
node_work_route -->|"compiled"| node_astro_build
node_feed_endpoint -->|"generated"| node_astro_build
node_robots_endpoint -->|"generated"| node_astro_build
node_astro_build -->|"emits"| node_static_output

click node_content_config "https://github.com/markhorn-dev/astro-nano/blob/main/src/content/config.ts"
click node_blog_content "https://github.com/markhorn-dev/astro-nano/tree/main/src/content/blog"
click node_project_content "https://github.com/markhorn-dev/astro-nano/tree/main/src/content/projects"
click node_work_content "https://github.com/markhorn-dev/astro-nano/tree/main/src/content/work"
click node_content_defs "https://github.com/markhorn-dev/astro-nano/blob/main/src/consts.ts"
click node_home "https://github.com/markhorn-dev/astro-nano/blob/main/src/pages/index.astro"
click node_blog_routes "https://github.com/markhorn-dev/astro-nano/blob/main/src/pages/blog/%5B...slug%5D.astro"
click node_project_routes "https://github.com/markhorn-dev/astro-nano/blob/main/src/pages/projects/%5B...slug%5D.astro"
click node_work_route "https://github.com/markhorn-dev/astro-nano/blob/main/src/pages/work/index.astro"
click node_feed_endpoint "https://github.com/markhorn-dev/astro-nano/blob/main/src/pages/rss.xml.ts"
click node_robots_endpoint "https://github.com/markhorn-dev/astro-nano/blob/main/src/pages/robots.txt.ts"
click node_page_layout "https://github.com/markhorn-dev/astro-nano/blob/main/src/layouts/PageLayout.astro"
click node_site_chrome "https://github.com/markhorn-dev/astro-nano/blob/main/src/components/Head.astro"
click node_content_components "https://github.com/markhorn-dev/astro-nano/blob/main/src/components/Container.astro"
click node_styles "https://github.com/markhorn-dev/astro-nano/blob/main/src/styles/global.css"
click node_astro_build "https://github.com/markhorn-dev/astro-nano/blob/main/astro.config.mjs"
click node_static_assets "https://github.com/markhorn-dev/astro-nano/tree/main/public/fonts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_content_config,node_blog_content,node_project_content,node_work_content,node_content_defs toneBlue
class node_home,node_blog_routes,node_project_routes,node_work_route,node_feed_endpoint,node_robots_endpoint toneAmber
class node_page_layout,node_site_chrome,node_content_components,node_styles toneMint
class node_astro_build,node_static_output,node_static_assets toneRose
```

## Components

### Content

Versioned collections define published entries.

- [Collection schema](https://github.com/markhorn-dev/astro-nano/blob/main/src/content/config.ts): Astro content config · Validates collection entries and metadata. · `src/content/config.ts`
- [Blog collection](https://github.com/markhorn-dev/astro-nano/tree/main/src/content/blog): Markdown and MDX content · Includes MDX with embedded Astro components. · `src/content/blog`
- [Projects collection](https://github.com/markhorn-dev/astro-nano/tree/main/src/content/projects): Markdown content · `src/content/projects`
- [Work collection](https://github.com/markhorn-dev/astro-nano/tree/main/src/content/work): Markdown content · `src/content/work`
- [Content metadata](https://github.com/markhorn-dev/astro-nano/blob/main/src/consts.ts): TypeScript constants and types · Supports filtering, ordering, drafts, and route generation. · `src/consts.ts`

### Public routes

Filesystem pages and generated endpoints.

- [Home](https://github.com/markhorn-dev/astro-nano/blob/main/src/pages/index.astro): Astro page · `src/pages/index.astro`
- [Blog listing and detail](https://github.com/markhorn-dev/astro-nano/blob/main/src/pages/blog/%5B...slug%5D.astro): Astro routes · Catch-all detail route resolves entry slugs. · `src/pages/blog/[...slug].astro`
- [Projects listing and detail](https://github.com/markhorn-dev/astro-nano/blob/main/src/pages/projects/%5B...slug%5D.astro): Astro routes · Catch-all detail route resolves entry slugs. · `src/pages/projects/[...slug].astro`
- [Work listing](https://github.com/markhorn-dev/astro-nano/blob/main/src/pages/work/index.astro): Astro page · `src/pages/work/index.astro`
- [RSS feed](https://github.com/markhorn-dev/astro-nano/blob/main/src/pages/rss.xml.ts): Generated endpoint · `src/pages/rss.xml.ts`
- [Robots endpoint](https://github.com/markhorn-dev/astro-nano/blob/main/src/pages/robots.txt.ts): Generated endpoint · `src/pages/robots.txt.ts`

### Shared presentation

Common shell and reusable visual components.

- [Page layout](https://github.com/markhorn-dev/astro-nano/blob/main/src/layouts/PageLayout.astro): Astro layout · Provides the common page-level structure. · `src/layouts/PageLayout.astro`
- [Site chrome and metadata](https://github.com/markhorn-dev/astro-nano/blob/main/src/components/Head.astro): Astro components · Head, header, and footer separate global concerns. · `src/components/Head.astro`
- [Content presentation](https://github.com/markhorn-dev/astro-nano/blob/main/src/components/Container.astro): Astro components · Shared container, cards, and links keep routes consistent. · `src/components/Container.astro`
- [Styling system](https://github.com/markhorn-dev/astro-nano/blob/main/src/styles/global.css): Global CSS and Tailwind · 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](https://github.com/markhorn-dev/astro-nano/blob/main/astro.config.mjs): Static site generator · Compiles routes, collections, MDX, and integrations at build time. · `astro.config.mjs`
- **Static site output**: Deployable static files · Served by static-friendly hosts such as Vercel or Netlify.
- [Public fonts](https://github.com/markhorn-dev/astro-nano/tree/main/public/fonts): Static assets · `public/fonts`

## Connections

- 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
