Astro Fox is a fast and lightweight Astro template generator for blogs and portfolios. Easily start your project with CLI tools and quickly build a personal site with blog, log, and project sections.
- π CLI Generator: Create new projects with simple commands
- π― Perfect Performance: Lighthouse 100/100 score
- π SEO Optimized: Built-in SEO best practices (meta tags, Open Graph, sitemaps)
- π Dark/Light Mode: Automatic detection of system theme with manual toggle
- π± Responsive Design: Optimized experience on all devices
- π Integrated Search: Fast content search with pagefind
- π Markdown & MDX: Convenient content writing
- π§© Modular Components: Built with SolidJS components
- π¨ Smooth Animations: Appropriate transition effects
- π RSS Feed: Automatically generated RSS feed
Perfect Lighthouse scores across all categories: Performance, Accessibility, Best Practices, and SEO.
# Install globally with npm
npm install -g @cj.lim/astro-fox
# Create a new project
astro-fox init my-blog
# Navigate to project folder
cd my-blog
# Start development server
pnpm run dev
Astro Fox uses pnpm by default, but supports all major package managers (npm, yarn, pnpm). Choose one package manager and use it consistently throughout these commands.
# Clone repository
git clone https://github.com/LimChaeJune/astro-fox
# Navigate to project folder
cd astro-fox
# Install dependencies with your preferred package manager
pnpm install
# Start development server
pnpm run dev
# Build for production
pnpm run build
The following scripts are available regardless of which package manager you choose:
# Start development server
pnpm run dev
# Build for production
pnpm run build
# Preview production build
pnpm run preview
# Run ESLint
pnpm run lint
# Fix ESLint issues
pnpm run lint:fix
# Format code with Prettier
pnpm run format
# Check formatting with Prettier
pnpm run format:check
/
βββ cli/ # CLI tools
βββ public/
β βββ fonts/ # Web fonts
β βββ js/ # Client scripts
βββ src/
β βββ app/
β β βββ components/ # App common components
β β βββ layouts/ # Layout components
β β βββ styles/ # Global styles
β βββ components/
β β βββ blog/ # Blog-related components
β β βββ log/ # Log-related components
β β βββ project/ # Project-related components
β β βββ common/ # Common UI components
β β βββ about/ # About page components
β βββ content/
β β βββ blog/ # Blog posts (Markdown/MDX)
β β βββ log/ # Log entries (Markdown/MDX)
β β βββ projects/ # Project information (Markdown/MDX)
β βββ pages/ # Astro pages
β βββ index.astro # Home page
β βββ blog/ # Blog pages
β β βββ index.astro # Blog list page
β β βββ [...slug].astro # Dynamic blog post page
β βββ log/ # Log pages
β β βββ index.astro # Log list page
β β βββ [...slug].astro # Dynamic log entry page
β βββ projects/ # Project pages
β β βββ index.astro # Project list page
β β βββ [...slug].astro # Dynamic project detail page
β βββ about/ # About page
β βββ index.astro # About page
βββ package.json
The [...slug].astro
files are used for dynamic routing in Astro:
Astro Fox CLI is a tool for quickly creating and configuring new projects.
# install @cj.lim/astro-fox
npm install -g @cj.lim/astro-fox
# Create a new project
astro-fox init <project-name>
# Create a new blog post
astro-fox blog "My New Post" -d "A short description" -t "tag1,tag2"
# Create a new log entry
astro-fox log "Daily Log" -d "What I did today" -t "work,learning"
# Create a new project entry
astro-fox projects "Project Alpha" -d "Details about the project" -c "MyCompany" -s "2024-01-01" -e "2024-12-31"
# View help
astro-fox --help
# Check version
astro-fox --version
All blog posts are stored in src/content/blog
as Markdown or MDX files. Each post needs frontmatter with the following fields:
---
title: "Post Title"
summary: "Brief description"
date: 2024-04-07
tags: ["astro", "web development"]
categories: "category"
image: "image-path" # optional
draft: true # optional
---
Content goes here...
The frontmatter schema is defined in src/content/config.ts
using Astro's Content Collections API. You can check and modify the schema definitions there.
- Logs are stored in
src/content/log
. - Projects are stored in
src/content/projects
.
This template uses TailwindCSS. You can customize the theme by editing tailwind.config.mjs
.
These files should be modified to personalize your site:
export default defineConfig({
site: "https://yourdomain.com", // Replace with your domain
build: {
format: "file", // build format
inlineStylesheets: "auto", // css optimization
},
});
Astro Fox is based on static site generation (SSG) and can be easily deployed to various hosting services:
- Vercel: Connect Git repository for automatic deployment
- Netlify: Connect Git repository or deploy with drag-and-drop
- Cloudflare Pages: Connect Git repository for automatic deployment
Theme inspired by Astro Sphere.
MIT