-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Getting Started
- Requirements
- Installation
- Running the project
- Available commands
- Project structure
- First steps after setup
- Node.js ≥ 22.12.0
- pnpm (recommended) — or npm, yarn, or bun
# pnpm
pnpm create astro@latest --template satnaing/astro-paper
# npm
npm create astro@latest -- --template satnaing/astro-paper
# yarn
yarn create astro --template satnaing/astro-paper
# bun
bun create astro@latest -- --template satnaing/astro-paperThis runs the Astro setup wizard, which handles cloning the template and installing dependencies.
git clone https://github.com/satnaing/astro-paper.git my-blog
cd my-blog
pnpm installGo to https://github.com/satnaing/astro-paper and click "Use this template" to create your own repository on GitHub.
# Start the dev server at http://localhost:4321
pnpm dev
# Build for production
pnpm build
# Preview the production build locally
pnpm preview| Command | Action |
|---|---|
pnpm install |
Install dependencies |
pnpm dev |
Start local dev server at localhost:4321
|
pnpm build |
Type-check, build, run Pagefind indexing, copy search index to public/pagefind/
|
pnpm preview |
Preview the production build locally |
pnpm sync |
Generate TypeScript types for Astro modules |
pnpm astro ... |
Run Astro CLI commands (e.g. astro add, astro check) |
pnpm format |
Format code with Prettier |
pnpm lint |
Lint code with ESLint |
Note:
pnpm buildruns bothastro buildand the Pagefind indexer. The search index is required for the search feature to work in production.
/
├── public/
│ ├── pagefind/ # auto-generated by pnpm build; do not edit
│ ├── favicon.svg
│ └── default-og.jpg # fallback OG image
├── src/
│ ├── assets/
│ │ ├── icons/ # SVG icons including social icons
│ │ └── images/ # static images used in posts/layouts
│ ├── components/ # Astro components (Header, Footer, Card, etc.)
│ ├── content/
│ │ ├── pages/ # standalone pages (e.g. about.md)
│ │ └── posts/ # blog posts (.md and .mdx files)
│ ├── i18n/ # UI string translations and date formatting
│ ├── layouts/ # page layouts (Layout.astro, PostLayout.astro)
│ ├── pages/ # Astro route pages (index, tags, archives, etc.)
│ ├── scripts/ # client-side scripts (theme toggle)
│ ├── styles/ # CSS (theme.css, global.css, typography.css)
│ ├── types/ # TypeScript types including config types
│ ├── utils/ # helper utilities
│ ├── config.ts # internal resolved config (do not edit directly)
│ └── content.config.ts # Astro content collection schema
├── astro-paper.config.ts # your site configuration (edit this)
└── astro.config.ts # Astro framework configuration-
src/content/posts/— all your blog posts go here. Supports.mdand.mdx. -
src/content/pages/— standalone content pages likeabout.md. -
astro-paper.config.ts— the main file you edit to configure your site. See Configuration. -
src/styles/theme.css— color scheme CSS variables. See Customization. -
public/— static assets served as-is (no processing). Place yourdefault-og.jpghere.
-
Configure your site — Open
astro-paper.config.tsand updatesite.url,site.title,site.description,site.author, andsocials. See Configuration for all options. -
Replace the default OG image — Swap
public/default-og.jpgwith your own fallback OG image (recommended size: 1200×640 px), or leavefeatures.dynamicOgImageenabled to generate OG images automatically. -
Update the About page — Edit
src/content/pages/about.mdwith your own content. -
Delete the sample posts — Remove the example posts in
src/content/posts/and add your own. -
Add your favicon — Replace
public/favicon.svgwith your own. -
Run a build — Run
pnpm buildto verify everything compiles, thenpnpm previewto see the production site.
Getting Started
Writing Content
Features & Reference
Deployment
Links