What version of astro are you using?
2.6.1
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
pnpm
What operating system are you using?
Mac
What browser are you using?
Firefox
Describe the Bug
This may simply be a problem with my understanding of the behavior or a clarification in the docs.
Background
I've looked at #440 and the docs regarding the build --drafts flag and the markdown.drafts configuration.
It looks to me like:
Astro's collection API is a nice addition, and it prevents 1000 ad-hoc almost compatible similar implementations from sprouting up. The idea of having items in a collection that aren't ready for production (drafts) seems like a good thing to have a convention around.
Proposal
This will take some discussion, but to start the discussion, I propose that:
-
When an item is marked draft it is included in the by default in astro dev and excluded by default in astro build, which can be overridden by config.markdown.drafts, which can be overridden by the --drafts flag.
-
When drafts are excluded, they're excluded everywhere. They don't exist--not their empty folders, their html, nor their RSS feeds. This prevents accidental info leaks and other embarrassments.
-
This behavior should be implemented in the collections API.
Next Steps
All those assertions are debatable, but I think form a good starting point. If we can agree on behavior and api, I'd be willing to submit a PR.
35055
Link to Minimal Reproducible Example
https://stackblitz.com/github/bradobro/astro-test-drafts?file=README.md
Participation
What version of
astroare you using?2.6.1
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
pnpm
What operating system are you using?
Mac
What browser are you using?
Firefox
Describe the Bug
This may simply be a problem with my understanding of the behavior or a clarification in the docs.
Background
I've looked at #440 and the docs regarding the
build --draftsflag and the markdown.drafts configuration.It looks to me like:
--draftsflag isn't wired in to code yetmarkdown.draftsflag. AFAICT it's ignored by the collections API, the stock blog template, and other 3rd party templates (my stackblitz example only demonstrates that the draft pages are built whether or not the flag is present).Astro's collection API is a nice addition, and it prevents 1000 ad-hoc almost compatible similar implementations from sprouting up. The idea of having items in a collection that aren't ready for production (drafts) seems like a good thing to have a convention around.
Proposal
This will take some discussion, but to start the discussion, I propose that:
When an item is marked
draftit is included in the by default inastro devand excluded by default inastro build, which can be overridden byconfig.markdown.drafts, which can be overridden by the--draftsflag.When drafts are excluded, they're excluded everywhere. They don't exist--not their empty folders, their html, nor their RSS feeds. This prevents accidental info leaks and other embarrassments.
This behavior should be implemented in the collections API.
Next Steps
All those assertions are debatable, but I think form a good starting point. If we can agree on behavior and api, I'd be willing to submit a PR.
35055
Link to Minimal Reproducible Example
https://stackblitz.com/github/bradobro/astro-test-drafts?file=README.md
Participation