Thu Jul 03
This is an explanation of the project structure and commands of the Astrto Starter template.
This page contains the full README for the template, including usage instructions and the projectβs directory structure. If youβre looking for a clean, powerful starter built with Astro, Tailwind CSS, and TypeScript, feel free to make use of this template! π
π Astro + Tailwind + TypeScript Template
A clean and modern starter template built with Astro, Tailwind CSS, and TypeScript. Ideal for building fast, accessible, and SEO-friendly static websites.
Demo β https://dev-astro-three.vercel.app/ β
π§ Tech Stack Versions
This template uses the following versions at release:
- Astro: ^5.10.0
- Tailwind CSS: ^4.1.10
- TypeScript: ^5.8.3
π Directory Structure
/
βββ public/
βββ src/
β βββ assets/ # Static assets (images, fonts, etc.)
β βββ components/ # Reusable UI components
β βββ content/ # Markdown blog content
β β βββ blog/
β βββ env.ts # Defines base URL for Astro environment
β βββ icons/ # Assets for Astro Icon
β βββ layouts/ # Layout components
β βββ pages/ # Astro page files
β βββ scripts/ # Client-side scripts
β βββ styles/ # Global CSS
β βββ types/ # TypeScript type definitions
βββ package.json
π Getting Started
1. Install dependencies
npm install
2. Start the development server
npm run dev
Starts local dev server at http://localhost:4321 β
Note:
Pagefind (the search function) will not work in development mode. Run npm run build to enable it.
3. Build for production
npm run build
4. Preview the production build
npm run preview
π οΈ Astro CLI
You can use the official Astro CLI with the following commands:
Command | Description |
---|---|
npm run astro ... | Run Astro CLI commands like astro add , astro check |
npm run astro -- --help | Get help using the Astro CLI |
βοΈ Environment Base URL
You can change the base URL by specifying ASTRO_BASE
during the build process.
In src/env.ts
, the BASE_URL
constant is exported to be reused throughout the site:
export const BASE_URL = (import.meta.env.ASTRO_BASE || '/').replace(/\/?$/, '/');
By using BASE_URL
in your links, your site will work correctly even when deployed under a subdirectory:
<a href={`${BASE_URL}`}>
π§ Customization
You can customize colors, fonts, OGP, and more in the following locations:
src/styles/global.css
src/components
(UI components)src/layouts
(layout structure)src/content/blog
(content)
β Features
- β Astro + Tailwind CSS + TypeScript
- β Blog functionality with Markdown
- β Accessible UI components (tabs, accordion, etc.)
- β Mobile-first responsive design
- β Dark mode support
- β SEO & OGP configured
- β Search powered by Pagefind
π¦ Deployment
You can deploy easily to Vercel, Netlify, GitHub Pages, etc.
npm run build
β Upload the generated dist/
folder to your hosting platform.
π License
MIT
Note:
This template is licensed under the MIT License.
However, redistribution or resale of this template (modified or unmodified) as a competing product is not allowed without explicit permission from the author.
π Special Thanks
This template is dedicated to everyone who loves Astro and Tailwind.
Created by: mooonycat β¨