astro-static-site
Installation
SKILL.md
Astro Static Site
Build static websites with Astro + React + TypeScript + TailwindCSS, deployed to GitHub Pages.
Initialization Workflow
Astro must be created in an empty directory. For existing repos (the usual case), use /tmp:
cd /tmp
npm create astro@latest my-site -- --template minimal --typescript strictest
cp -a /tmp/my-site/. /path/to/repo/
cd /path/to/repo
npx astro add react
npx astro add tailwind
npx astro add sitemap
After initialization, set up the project structure:
- Create required directories:
docs/,mockups/(for documentation and Google Stitch mockups) - Copy asset templates from this skill's
assets/directory:assets/deploy.yml→.github/workflows/deploy.ymlassets/devcontainer.json→.devcontainer/devcontainer.jsonassets/SEO.astro→src/components/SEO.astroassets/Layout.astro→src/layouts/Layout.astroassets/robots.txt→public/robots.txt(replace__SITE_URL__with actual site URL)
- Configure
astro.config.mjswithsiteandbasefor GitHub Pages - Add a default OG image at
public/og-default.png(1200x630px)
Configuration
astro.config.mjs
import { defineConfig } from 'astro/config';
import react from '@astrojs/react';
import sitemap from '@astrojs/sitemap';
export default defineConfig({
site: 'https://<username>.github.io',
base: '/<repo-name>', // omit for user sites or custom domains
output: 'static',
integrations: [react(), sitemap()],
});
Dev Container
The project runs from totophe/dc-toolbelt. Available images:
ghcr.io/totophe/dc-toolbelt:node24-astro— lightweight, Astro-focusedghcr.io/totophe/dc-toolbelt:node24-toolbox— full toolbox with cloud CLIs
Port 4321 is forwarded for the Astro dev server.
Key Patterns
Pages use the Layout component with SEO props
---
import Layout from '../layouts/Layout.astro';
---
<Layout title="Page Title" description="Page description">
<main><!-- content --></main>
</Layout>
React components need client directives
<MyComponent client:load /> <!-- immediate -->
<MyComponent client:visible /> <!-- when scrolled into view (preferred) -->
Tailwind v4 — no config file needed
Configuration is done in CSS via @import "tailwindcss" in src/styles/global.css.
GitHub Pages deployment
- Workflow at
.github/workflows/deploy.ymluseswithastro/action@v5 - Set repo Settings > Pages > Source to GitHub Actions
- For custom domains: add
public/CNAME, updatesite, removebase
SEO Checklist
-
siteset inastro.config.mjs - SEO component used in all layouts with title + description
- Default OG image at
public/og-default.png(1200x630) -
public/robots.txtwith sitemap URL - Sitemap integration enabled
- Structured data (JSON-LD) for key pages
-
<Image />component for optimized images -
client:visiblepreferred overclient:loadfor non-critical components
References
references/astro-setup.md— Detailed Astro project setup, integrations, content collections, view transitionsreferences/github-pages.md— GitHub Pages deployment, GitHub Actions workflow, dev container configurationreferences/seo.md— SEO meta tags, OG images, structured data, performance checklist
Mockups
When mockups exist in the mockups/ folder (typically Google Stitch exports), read them to understand the target design before building pages. Use them as the source of truth for layout, colors, and component structure.
Weekly Installs
2
Repository
totophe/skillsFirst Seen
Mar 10, 2026
Security Audits
Installed on
amp1
cline1
opencode1
cursor1
kimi-cli1
codex1