0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-30 22:03:56 -05:00
astro/examples/with-content
Ben Holmes 52209ca2ad
[Content collections] Remove experimental flag (#5825)
* refactor: remove experimental.cc from core

* chore: remove experimental flag from tests

* fix: mock contentDir in remark tests

* fix: check vfile.path in rel-image-error plugin

* fix: move .astro/ excludes to all test/fixtures

* fix: include test/**/fixtures in ignore

* chore: changeset
2023-01-11 12:51:31 -05:00
..
.astro [ci] format 2023-01-10 23:03:59 +00:00
.vscode Content Collections (#5291) 2022-12-16 14:19:53 -05:00
public Content Collections (#5291) 2022-12-16 14:19:53 -05:00
src [Content collections] Move generated types to .astro directory (#5786) 2023-01-10 18:01:52 -05:00
.gitignore Content Collections (#5291) 2022-12-16 14:19:53 -05:00
astro.config.mjs [Content collections] Remove experimental flag (#5825) 2023-01-11 12:51:31 -05:00
package.json [ci] release (beta) (#5742) 2023-01-06 13:00:12 -05:00
README.md Fix links in content used by docs (#5631) 2022-12-18 13:00:30 +01:00
sandbox.config.json Content Collections (#5291) 2022-12-16 14:19:53 -05:00
tsconfig.json Content Collections (#5291) 2022-12-16 14:19:53 -05:00

Astro Content Collections (Experimental)

This demos our Blog Starter using the experimental Content Collections API.

Open in StackBlitz Open with CodeSandbox

🧑‍🚀 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.