Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add documentation for draft sidebar behavior #2825

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/src/content/docs/reference/frontmatter.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---
Expand All @@ -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).
Comment on lines +286 to +287
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small suggestion for your consideration:

  • Avoids the “sidebar links […] in your sidebar config” repetition
  • Tries specifying “directories” for the second option here to clarify the relationship between page and group
Suggested change
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.

Happy for you to decide what to do with this! In general the change is definitely and improvement — thanks @HiDeoo 💜


### `sidebar`

**type:** [`SidebarConfig`](#sidebarconfig)
Expand Down
Loading