From 7035ab27870ab6975c90e12ae332a709bc29f6eb Mon Sep 17 00:00:00 2001 From: HiDeoo <494699+HiDeoo@users.noreply.github.com> Date: Thu, 23 Jan 2025 16:16:09 +0100 Subject: [PATCH 1/2] docs: add sidebar explanation to `draft` frontmatter option --- docs/src/content/docs/reference/frontmatter.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/src/content/docs/reference/frontmatter.md b/docs/src/content/docs/reference/frontmatter.md index 5c0f0b44527..1d814692e92 100644 --- a/docs/src/content/docs/reference/frontmatter.md +++ b/docs/src/content/docs/reference/frontmatter.md @@ -273,7 +273,7 @@ pagefind: false **type:** `boolean` **default:** `false` -Set whether this page should be considered a draft and not be included in [production builds](https://docs.astro.build/en/reference/cli-reference/#astro-build) and [autogenerated link groups](/guides/sidebar/#autogenerated-groups). Set to `true` to mark a page as a draft and make it only visible during development. +Set whether this page should be considered a draft and not be included in [production builds](https://docs.astro.build/en/reference/cli-reference/#astro-build). Set to `true` to mark a page as a draft and make it only visible during development. ```md --- @@ -283,6 +283,9 @@ draft: true --- ``` +Because draft pages are not included in build output, you cannot add sidebar links to draft pages in your site sidebar config using [slugs](/guides/sidebar/#internal-links). +Links to draft pages are not included in [autogenerated sidebar groups](/guides/sidebar/#autogenerated-groups). + ### `sidebar` **type:** [`SidebarConfig`](#sidebarconfig) From 77f67cba0134e951ac3e3cdbeb26b6cb92e97870 Mon Sep 17 00:00:00 2001 From: Chris Swithinbank Date: Tue, 28 Jan 2025 19:33:01 +0100 Subject: [PATCH 2/2] Update docs/src/content/docs/reference/frontmatter.md --- docs/src/content/docs/reference/frontmatter.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/content/docs/reference/frontmatter.md b/docs/src/content/docs/reference/frontmatter.md index 1d814692e92..37c4513e1fa 100644 --- a/docs/src/content/docs/reference/frontmatter.md +++ b/docs/src/content/docs/reference/frontmatter.md @@ -283,8 +283,8 @@ draft: true --- ``` -Because draft pages are not included in build output, you cannot add sidebar links to draft pages in your site sidebar config using [slugs](/guides/sidebar/#internal-links). -Links to draft pages are not included in [autogenerated sidebar groups](/guides/sidebar/#autogenerated-groups). +Because draft pages are not included in build output, you cannot add draft pages directly to your site sidebar config using [slugs](/guides/sidebar/#internal-links). +Draft pages in directories used for [autogenerated sidebar groups](/guides/sidebar/#autogenerated-groups) are automatically excluded in production builds. ### `sidebar`