From 7135c4495937b1d8015b4b00766f1d0dafb97256 Mon Sep 17 00:00:00 2001 From: sarahrainsberger Date: Sat, 5 Oct 2024 15:47:08 +0000 Subject: [PATCH] update filetree to show collections --- .../docs/en/basics/project-structure.mdx | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/src/content/docs/en/basics/project-structure.mdx b/src/content/docs/en/basics/project-structure.mdx index 20b932c4a748a..52377922447df 100644 --- a/src/content/docs/en/basics/project-structure.mdx +++ b/src/content/docs/en/basics/project-structure.mdx @@ -32,14 +32,20 @@ A common Astro project directory might look like this: - components/ - Header.astro - Button.jsx + - content/ + - config.ts + - posts/ + - post1.md + - post2.md + - post3.md - layouts/ - PostLayout.astro - pages/ - posts/ - - post1.md - - post2.md - - post3.md - - index.astro + - [post].astro + - about.astro + - **index.astro** + - rss.xml.js - styles/ - global.css - astro.config.mjs @@ -66,6 +72,14 @@ Some files (like Astro components) are not even sent to the browser as written b While this guide describes some popular conventions used in the Astro community, the only directories reserved by Astro are `src/pages/` and `src/content/`. You are free to rename and reorganize any other directories in a way that works best for you. ::: +### `src/pages` + +Pages routes are created for your site by adding [supported file types](/en/basics/astro-pages/#supported-page-files) to this directory. + +:::caution +`src/pages` is a **required** sub-directory in your Astro project. Without it, your site will have no pages or routes! +::: + ### `src/components` **Components** are reusable units of code for your HTML pages. These could be [Astro components](/en/basics/astro-components/), or [UI framework components](/en/guides/framework-components/) like React or Vue. It is common to group and organize all of your project components together in this folder. @@ -74,7 +88,7 @@ This is a common convention in Astro projects, but it is not required. Feel free ### `src/content` -The `src/content/` directory is reserved to store [content collections](/en/guides/content-collections/) and an optional collections configuration file. No other files are allowed inside this folder. +The `src/content/` directory is reserved to store [content collections](/en/guides/content-collections/) and a configuration file. No other files are allowed inside this folder. ### `src/layouts` @@ -82,14 +96,6 @@ The `src/content/` directory is reserved to store [content collections](/en/guid Just like `src/components`, this directory is a common convention but not required. -### `src/pages` - -[Pages](/en/basics/astro-pages/) are a special kind of component used to create new pages on your site. A page can be an Astro component, or a Markdown file that represents some page of content for your site. - -:::caution -`src/pages` is a **required** sub-directory in your Astro project. Without it, your site will have no pages or routes! -::: - ### `src/styles` It is a common convention to store your CSS or Sass files in a `src/styles` directory, but this is not required. As long as your styles live somewhere in the `src/` directory and are imported correctly, Astro will handle and optimize them.