A content-first Astro starter for crafting sites by hand.
Write markdown. Push to GitHub. Live in 30 seconds.
Note: This file lives in
.github/README.mdrather than the repository root. This is intentional — it prevents merge conflicts when site repos pull framework updates, since every site has its own rootREADME.md. After forking, you may keep it here for reference or delete it — it won't conflict with your rootREADME.mdeither way.
git clone https://github.com/danrichardson/loomwork.git my-site
cd my-site
git remote remove origin
git remote add origin https://github.com/YOUR-USER/YOUR-SITE.git
git remote add loomwork https://github.com/danrichardson/loomwork.git
npm install
npm run dev # → http://localhost:4321Delete these before building your site — they're loomwork repo files, not part of the framework:
rm -rf docs/ # loomwork project docs, prompts, auditsKeep UPGRADE.md if you want the upgrade guide handy for future framework
updates. Otherwise, you can always find it at the loomwork repo.
Then replace the loomwork placeholder content:
rm src/content/pages/about_Loomwork.mdx
rm src/content/pages/guide.mdx
rm src/content/pages/mobile-app.mdx
rm src/content/pages/building.mdx
rm src/content/pages/page-types.mdx
rm src/content/pages/reader-controls.mdx
rm src/content/pages/theming.mdx
rm -rf src/content/pages/deep-dives/
rm -f public/images/1771364152056-image.jpgThen create your own project README:
echo "# My Site" > README.mdsrc/site.config.ts- Name, tagline, nav, footer, email, fontssrc/styles/site.css- Override colors, fonts, spacingastro.config.mjs- Your site URLwrangler.toml- Cloudflare project name and custom domains- Replace content in
src/content/pages/ - Customize
src/pages/index.astro(your homepage) - Push to GitHub → connect to Cloudflare → live
src/
├── site.config.ts ← SITE FILE: name, nav, footer, fonts
├── content.config.ts ← FRAMEWORK: content collection schemas
├── styles/
│ ├── global.css ← FRAMEWORK: base styles, reset, utilities
│ └── site.css ← SITE FILE: your color/font overrides
├── content/
│ ├── pages/ ← SITE FILE: your MDX content
│ └── posts/ ← SITE FILE: optional blog posts
├── components/
│ ├── *.astro ← FRAMEWORK: shared components
│ └── mobile/ ← FRAMEWORK: mobile editor components
├── layouts/
│ ├── Base.astro ← FRAMEWORK: HTML shell
│ ├── Content.astro ← FRAMEWORK: standard page layout
│ └── Longform.astro ← FRAMEWORK: split-panel deep dives
└── pages/
├── index.astro ← SITE FILE: your homepage
├── [...slug].astro ← FRAMEWORK: renders content pages
├── 404.astro ← FRAMEWORK: not found page
└── mobile/ ← FRAMEWORK: mobile editor PWA
This matters if you want to pull framework updates from the loomwork repo.
| File | Purpose |
|---|---|
src/layouts/Base.astro |
HTML shell, meta tags, font loading |
src/layouts/Content.astro |
Content page chrome, template variants |
src/layouts/Longform.astro |
Split-panel deep dive layout |
src/components/*.astro |
Callout, YouTube, Header, Footer, TOC, etc. |
src/components/mobile/ |
Mobile editor React components |
src/styles/global.css |
Reset, base typography, utilities |
src/content.config.ts |
Content collection schemas |
src/pages/[...slug].astro |
Dynamic route for content pages |
src/pages/404.astro |
Not found page |
src/pages/mobile/ |
Mobile editor PWA page (served at /mobile) |
public/_headers |
Security headers (Cloudflare Pages) |
public/_redirects |
URL redirects |
public/.assetsignore |
Cloudflare deploy fix |
public/mobile/ |
PWA manifest and service worker |
| File | Purpose |
|---|---|
src/site.config.ts |
Site identity, navigation, fonts |
src/styles/site.css |
CSS variable overrides, site-specific styles |
src/pages/index.astro |
Homepage layout and content |
src/content/pages/*.mdx |
All your site content |
src/content/posts/*.mdx |
Blog posts (optional) |
astro.config.mjs |
Site URL (change one line) |
wrangler.toml |
Cloudflare project name and routes |
package.json |
Project name |
README.md |
Your project README (not provided by loomwork) |
Set up loomwork as an upstream remote (one-time):
git remote add loomwork https://github.com/danrichardson/loomwork.gitWhen loomwork gets updates:
git fetch loomwork
git merge loomwork/main
npm install
npm run buildFramework files merge cleanly because you haven't edited them. Site files won't conflict because loomwork only has placeholder versions.
See docs/UPGRADE.md in the loomwork repo for the full guide with conflict resolution, CSS variable migration, rollback instructions, and dependency handling.
Loomwork includes a built-in PWA at /mobile that lets you edit and create content pages directly from a phone, committing changes to GitHub without a desktop. It is a framework feature — do not delete src/pages/mobile/ or src/components/mobile/ when cleaning up loomwork placeholder files.
The content page src/content/pages/mobile-app.mdx is a placeholder and should be deleted. The mobile editor itself lives in src/pages/mobile/ and is separate from your site content.
The styling system has two layers:
global.css (framework) - Contains the CSS reset, base typography, component styles, and utility classes. All values reference CSS custom properties. Don't edit this in site repos.
site.css (yours) - Override any CSS variable to rebrand:
:root {
--color-accent: #2d6a4f;
--color-accent-hover: #1b4332;
--color-accent-light: #d1fae5;
--font-heading: "Bitter", Georgia, serif;
--font-body: "Source Sans 3", system-ui, sans-serif;
}
/* Site-specific styles go here too */To use Google Fonts, set fonts_url in site.config.ts:
fonts_url: "https://fonts.googleapis.com/css2?family=Bitter:wght@400;700&family=Source+Sans+3:wght@400;600;700&display=swap",Create .mdx files in src/content/pages/. Frontmatter:
---
title: "Page Title"
description: "SEO description, max 160 chars."
section: "guides"
nav_order: 10
template: "guide" # default | landing | guide | tool | longform
draft: false
---File path = URL: src/content/pages/docs/intro.mdx → /docs/intro
import Callout from '../../components/Callout.astro';
<Callout type="tip" title="Pro tip">
Components render inline in your markdown.
</Callout>Available: Callout (info/warning/tip/danger), YouTube (video embeds).
default- Centered content, comfortable reading widthlanding- Wide container, no sidebarguide- Sticky table of contents sidebar on desktoptool- Minimal chrome for interactive React componentslongform- Split-panel: fixed sidebar index + scrollable content (deep dives, essays)
- Push to GitHub
- Cloudflare Dashboard → Workers & Pages → Create → Connect to Git
- Build command:
npm run build/ Output:dist - Add custom domains in Settings → Domains & Routes
// src/components/Calculator.tsx
import { useState } from "react";
export default function Calculator() {
const [val, setVal] = useState(0);
return <div>...</div>;
}import Calculator from '../components/Calculator';
<Calculator client:load />- Astro 5 - Static site generator with MDX and React islands
- Cloudflare Workers - Free global hosting, auto-deploy from GitHub
- MDX - Markdown with inline components
- Content Collections - Schema-validated content with TypeScript