From ac803860416a5f2af36453a086d684d6b00c3edf Mon Sep 17 00:00:00 2001 From: Sarah Rainsberger Date: Wed, 18 Jan 2023 17:06:28 +0000 Subject: [PATCH 1/6] content collections in styling, markdown pages --- src/pages/en/guides/markdown-content.mdx | 29 ++++++++++++++++++++++-- src/pages/en/guides/styling.mdx | 9 +++++++- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/src/pages/en/guides/markdown-content.mdx b/src/pages/en/guides/markdown-content.mdx index 78229e0ad795b..d6a57cfb384cc 100644 --- a/src/pages/en/guides/markdown-content.mdx +++ b/src/pages/en/guides/markdown-content.mdx @@ -6,6 +6,7 @@ i18nReady: true --- import Since from '~/components/Since.astro' +import FileTree from '~/components/FileTree.astro' [Markdown](https://daringfireball.net/projects/markdown/) is commonly used to author text-heavy content like blog posts and documentation. Astro includes built-in support for standard Markdown files. @@ -15,6 +16,28 @@ Use either or both types of files to write your Markdown content! ## Markdown and MDX Pages +### Content collections + +Astro allows you to manage your Markdown and MDX files in Astro in a special `src/content/` folder. [Content collections](/en/guides/content-collections/) will organize your content, validate your frontmatter, and provide automatic TypeScript type-safety of fetched content. + + +- src/content/ + - **newsletter/** + - week-1.md + - week-2.md + - week-3.md + - **authors/** + - grace-hopper.md + - alan-turing.md + - batman.md + + + +Available in both SSG and SSR mode, collections can optionally include schemas to enforce consistent frontmatter within each collection and provide helpful autocompletion. + +See more about using [content collections in Astro](/en/guides/content-collections/). + + ### File-based Routing Astro treats any `.md` (or alternative supported extension) or `.mdx` file inside of the `/src/pages/` directory as a page. @@ -131,6 +154,9 @@ const {frontmatter} = Astro.props; ``` +You can apply global styles to your Markdown with [`