Repository navigation
Document metadata for source-backed WordPress posts #73
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
Closed
Closed
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| --- | ||
| title: Content source metadata | ||
| description: Set the title, publication date, slug, and status of a source-backed WordPress document. | ||
| --- | ||
|
|
||
| When Content management is enabled for your team, Markdown and HTML files bound to WordPress documents can carry their own metadata. Use the document header below to preserve titles and publication dates during a migration. | ||
|
|
||
| ## Document metadata | ||
|
|
||
| Put a single-line JSON object inside a `spacefast:document` HTML comment at the very start of the file, before its body. Do not put a blank line or other text before the comment. | ||
|
|
||
| ```markdown content/posts/first-post.md | ||
| <!-- spacefast:document {"version":1,"title":"My first post","slug":"first-post","status":"publish","dateGmt":"2026-01-15T09:30:00Z"} --> | ||
|
|
||
| The post body starts here. | ||
| ``` | ||
|
|
||
| The same header works before an HTML document body. It stores WordPress fields separately from the editable content; it is not a visible heading or a page layout. | ||
|
|
||
| | Field | Required | Meaning | | ||
| | --- | --- | --- | | ||
| | `version` | Yes | Must be `1`. | | ||
| | `title` | Yes | The WordPress document title, up to 2,000 UTF-8 bytes. | | ||
| | `slug` | Yes | The WordPress document slug, up to 200 UTF-8 bytes. | | ||
| | `status` | Yes | `draft`, `pending`, `publish`, `private`, `future`, or `trash`. | | ||
| | `dateGmt` | No | Publication time in UTC, such as `2026-01-15T09:30:00Z`. Required when `status` is `future`. | | ||
| | `componentSource` | No | The original component path recorded by a source conversion. Preserve it when it is already present. | | ||
|
|
||
| `dateGmt` must end in `Z`. Fractional seconds are accepted but stored to whole seconds. Do not add other keys to the JSON object. | ||
|
|
||
| ## Editing and migration | ||
|
|
||
| WordPress editor saves write the metadata header back to the source file alongside the body. Preserve that header when you edit the file locally. Its JSON keys may be reordered when the source is saved. | ||
|
|
||
| Without this header, the source does not set the document's metadata. A new document gets a title derived from its filename or binding slug. Existing WordPress metadata is retained during source adoption. | ||
|
|
||
| YAML front matter is not read as document metadata. A `title:` or `date:` field between `---` lines does not set the WordPress title or publication date. Replace that front matter with the JSON header before publishing source-backed documents. Otherwise a migrated post's original date is not supplied to WordPress, which can change date-based query ordering. | ||
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
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.
🟡 Bug · Public page documents an internal-only, default-off feature under a name that doesn't exist
The header is only processed for teams with the
content.managedfeature. The monorepo feature registry (packages/common/src/contracts/feature-lifecycle.ts) lists it as "Managed content", stage internal, default off, with its docs channel set to the handbook (/features/content). The control plane gates content releases onevaluateFeature("content.managed").Public readers get a nav entry and two inline links to a feature they can't enable, and the page calls it "Content management", a name no UI or setting uses. This repo documents only shipped, publicly verifiable behavior (AGENTS.md).
Hold the page and cross-links until the feature is public, or move the content to the handbook. If it ships now, use the name "Managed content" and say how a team gets it enabled.
Found by Indent Review Agent
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.
Confirmed against the feature registry. Closed this public-docs PR and moved the guide to the private handbook in https://github.com/spacefast/contextslop/pull/6, with the
content.managedenablement prerequisite. Handbook typecheck, 53 tests, and build pass.View session