mirror of
https://github.com/withastro/astro.git
synced 2025-01-06 22:10:10 -05:00
c2180746b4
* feat: change cacheDir to `.astro` * feat: write reference in env.d.ts if none exists * chore: update with-content types * test: env.d.ts transform * nit: setUp -> add * refactor: content.d.ts -> types.d.ts * chore: update confirmation log * chore: changeset * feat: inject env.d.ts if none exists * feat: set up env.d.ts on `astro sync` * chore: duplicate envTsPathRelative * docs: update changeset * fix: make srcDir if none exists * fix: types.generated -> .astro in gitignore * feat: add env.d.ts to test gitignore * chore: remove env.d.ts from content-collections * test: move sync tests to `astro sync`, add file write test * refactor: simplify test gitignore to base * fix: add / to `.astro` bc that scares me |
||
---|---|---|
.. | ||
.astro | ||
.vscode | ||
public | ||
src | ||
.gitignore | ||
astro.config.mjs | ||
package.json | ||
README.md | ||
sandbox.config.json | ||
tsconfig.json |
Astro Content Collections (Experimental)
This demos our Blog Starter using the experimental Content Collections API.
🧑🚀 Seasoned astronaut? Delete this file. Have fun!
🚀 Project Structure
Inside of your Astro project, you'll see the following folders and files:
├── public/
├── src/
│ └── content/
│ └── blog/
│ ├── first.md
│ └── second.md
│ └── config.ts
│ ├── components/
│ ├── layouts/
│ └── pages/
├── astro.config.mjs
├── README.md
├── package.json
└── tsconfig.json
src/content/
contains "collections" of related Markdown and MDX documents. Astro will generate a getCollection
function to retrieve posts from src/content/
, and type-check your frontmatter using an optional schema (see src/content/config.ts
).
🧞 Commands
All commands are run from the root of the project, from a terminal:
Command | Action |
---|---|
npm install |
Installs dependencies |
npm run dev |
Starts local dev server at localhost:3000 |
npm run build |
Build your production site to ./dist/ |
npm run preview |
Preview your build locally, before deploying |
npm run astro ... |
Run CLI commands like astro add , astro check |
npm run astro --help |
Get help using the Astro CLI |
👀 Want to learn more?
Check out our documentation or jump into our Discord server.
Credit
This theme is based off of the lovely Bear Blog.