wolfboyyang / astro-tutorial

Astro Tutorial to build a blog

Home Page:https://astro-tutorial-wolfboyyang.netlify.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Astro 教程

pnpm create astro -- --template basics

Open in StackBlitz Open with CodeSandbox Open in GitHub Codespaces

🚀 升级到Astro 4 Beta

pnpm dlx @astrojs/upgrade beta

🚀 Project Structure

Inside of your Astro project, you'll see the following folders and files:

/
├── public/
│   └── favicon.svg
├── src/
│   ├── components/
│   │   └── Card.astro
│   ├── layouts/
│   │   └── Layout.astro
│   └── pages/
│       └── index.astro
└── package.json

Astro looks for .astro or .md files in the src/pages/ directory. Each page is exposed as a route based on its file name.

There's nothing special about src/components/, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.

Any static assets, like images, can be placed in the public/ directory.

🧞 Commands

All commands are run from the root of the project, from a terminal:

Command Action
pnpm install Installs dependencies
pnpm run dev Starts local dev server at localhost:4321
pnpm run build Build your production site to ./dist/
pnpm run preview Preview your build locally, before deploying
pnpm astro ... Run CLI commands like astro add, astro check
pnpm astro -- --help Get help using the Astro CLI

👀 Want to learn more?

Feel free to check our documentation or jump into our Discord server.

About

Astro Tutorial to build a blog

https://astro-tutorial-wolfboyyang.netlify.app/


Languages

Language:Astro 76.1%Language:JavaScript 10.7%Language:CSS 9.0%Language:TypeScript 4.2%