Skip to content

feat: add draft frontmatter flag to withhold guides from publishing - #1027

Open
LeaVerou wants to merge 1 commit into
mainfrom
guide-draft-flag
Open

feat: add draft frontmatter flag to withhold guides from publishing#1027
LeaVerou wants to merge 1 commit into
mainfrom
guide-draft-flag

Conversation

@LeaVerou

Copy link
Copy Markdown
Collaborator

Closes #1017

Adds:

  • draft frontmatter option. Guides can set draft: true (or any truthy value, e.g. draft: future) in frontmatter to be excluded from all distribution (search index, README, megaskill) without deleting them. Evals are unaffected — a draft guide with eval artifacts still runs.
    The value is intentionally not validated (per Frontmatter option to prevent guides from being published #1017 (comment) )
  • draft and isPublished properties in GuideInventory. isPublished (real content + not draft) is computed once as a guide-inventory property, consumed by all three build paths.

I also did a little minor refactoring to make the logic and dependencies in inventoryGuide() easier to follow, but I can revert it if needed.

Note: I kept the logic as-is to avoid regressions, but it's a little confusing that isStub is true even for a fully fleshed out guide…

Guides can set `draft: true` (or any truthy value, e.g. `draft: future`) in frontmatter to be excluded from all distribution (search index, README, megaskill) without deleting them. The value is intentionally not validated. Evals are unaffected — a draft guide with eval artifacts still runs.

`isPublished` (real content + not draft) is computed once as a guide-inventory property, consumed by all three build paths.

Part of #1017

@rviscomi rviscomi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Supportive of this change so LGTMing but it'd be good to get a technical review from @paulirish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Frontmatter option to prevent guides from being published

2 participants