-
Notifications
You must be signed in to change notification settings - Fork 2
feat(docs): require every published doc slug to be recorded in the Fern lock #515
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| --- | ||
| name: docs-site-publishing | ||
| description: >- | ||
| Wire a document under documentation/guides/ or documentation/concepts/ into the published Contentful | ||
| documentation site. Use when adding, renaming, moving, reordering, or removing a published document, | ||
| when editing a `fern:` frontmatter block, a group README `children:` list, or | ||
| documentation/fern-slugs.lock.json, and when `pnpm fern:check` fails. | ||
| argument-hint: '[document, group README, or the failing fern:check output]' | ||
| paths: documentation/guides/**, documentation/concepts/**, documentation/fern-slugs.lock.json | ||
| --- | ||
|
|
||
| # Publishing authored docs to the documentation site | ||
|
|
||
| Writing a document does not publish it. Publication is data, and two of its four requirements fail | ||
| silently — this skill exists for those two. | ||
|
|
||
| **Sources of truth** — read rather than restate: | ||
|
|
||
| - [`documentation/AGENTS.md`](../../documentation/AGENTS.md) "Publishing to the documentation site" — | ||
| the rules: the `fern:` block, title-from-heading, slugs, links, MDX safety. | ||
| - [`docs/ADRs/0002`](../../docs/ADRs/0002-generate-the-public-documentation-site-content-from-this-repository.md) | ||
| — why the exporter is shaped this way, and the three-layer sync. | ||
|
|
||
| ## The two silent failures | ||
|
|
||
| **A document absent from its group README `children:` is not published.** The exporter reads that | ||
| list and never scans the filesystem, so the page is invisible rather than an error. Nothing fails; the | ||
| page simply never exists on the site. | ||
|
|
||
| **`children:` order is the sidebar order, and it is global across the group, not per section.** A | ||
| page's position inside its `fern.section` comes from its index in the one `children:` list — so | ||
| inserting a `Migration guides` page second in `documentation/guides/README.md` puts it _first_ in the | ||
| Migration guides sidebar section. Place it where it should land in its own section. | ||
|
|
||
| ## Recording the slug | ||
|
|
||
| `pnpm docs:fern -- --update-lock`, then commit the lock diff **with the page**. This covers both a new | ||
| page and a changed slug; only the latter appends a redirect. Never hand-edit the lock. | ||
|
|
||
| A new page publishes without a lock entry, so this is easy to skip — but the slug then has no | ||
| protection, because the change check can only compare against a slug the lock already names. `pnpm | ||
| fern:check` rejects an unrecorded slug for that reason. | ||
|
|
||
| ## Checks | ||
|
|
||
| `pnpm fern:check` enforces the whole contract and reports `file:line: message` naming the fix. It also | ||
| runs from the `Stop` hook whenever published docs change, so a missed step surfaces without being | ||
| asked for. | ||
|
|
||
| When a page is new or its slug, section, or order changed, run `pnpm docs:fern` and read | ||
| `fern-bundle/nav-block.yaml` — that is the artifact that ships, so it settles ordering questions that | ||
| reasoning about `children:` indices does not. | ||
|
|
||
| ## Reporting | ||
|
|
||
| Publication is **release-gated**: an edit reaches the site at the next release, not on merge. Say | ||
| which state you mean, and say whether the page is wired into `children:` and whether the lock entry | ||
| was recorded — a reader cannot tell from "docs updated". | ||
|
|
||
| ## Not in scope | ||
|
|
||
| Guide prose and structure (`optimization-guide-authoring`), migration routing | ||
| (`migration-guide-authoring`), fact derivation (`sdk-knowledge-authoring`), and the | ||
| `contentful-docs` repository's own conventions. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "name": "@contentful/skill-docs-site-publishing", | ||
| "version": "0.1.0", | ||
| "description": "Wire authored Optimization SDK docs into the published Contentful documentation site", | ||
| "license": "MIT", | ||
| "files": [ | ||
| "SKILL.md" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
Not in scopesection now lists onlysdk-knowledge-authoringfor fact derivation, but the previous version also referencedmigration-knowledge-authoringfor migration fact derivation. If that skill still exists, readers with migration fact questions may be directed to the wrong skill.Code suggestion
Code Review Run #876303
Should Bito avoid suggestions like this for future reviews? (Manage Rules)