Skip to content

feat: add page post type - #955

Open
rmdes wants to merge 2 commits into
mainfrom
feat/post-type-page
Open

rmdes wants to merge 2 commits into
mainfrom
feat/post-type-page

Conversation

@rmdes

@rmdes rmdes commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Fixes #954. Stacked on #951 (the first commit here is that PR’s): a page is recognised by its h=page vocabulary, so this only works once that lands.

The package

packages/post-type-page follows the other post-type packages: name: "Page", h: "page", fields name and content (required), summary, category, post-status, visibility; an icon; README; docs page and sidebar entry under Post types → Official plug-ins. Not added to the default post types.

Presets

Each preset gets a page case with no date and no collection, at a path each generator serves at /{slug} without configuration:

Preset post.path post.url
Eleventy {slug}.md {slug}
Hugo content/{slug}.md {slug}
Jekyll {slug}/index.md {slug}

Media under media/pages/ (Hugo: static/pages/, served at pages/).

Tests

  • Preset unit tests: a page entry in each fixture with the paths above (all three fail on main with the dated collection path).
  • endpoint-micropub integration: with @indiekit/post-type-page and @indiekit/preset-eleventy installed, h=page&name=About&content=… answers 202 with Location: https://website.example/about.

One thing I noticed while writing that test: Indiekit.postTypes is a single Map that a preset walks in its own init(), so a post type listed after the preset in plugins gets no paths (501 “No configuration provided for page post type”). The test lists the page type first. That affects every add-on post type, not only this one; I can open a separate issue if you’d like it addressed.

Verified locally: preset-eleventy 9/9, preset-jekyll 9/9, preset-hugo 12/12, endpoint-micropub 151/151; eslint and prettier clean.

A post type whose h value isn’t entry is identified by that vocabulary,
so a plug-in such as a page type no longer needs a discovery property
to avoid being filed as an article.

Fixes #950
A page is an undated post at the root of a website, such as /about or
/now. The package follows the other post-type packages; the presets
give a page an undated root path where each generator serves it.

Fixes #954
@rmdes rmdes added the plugin-post-type Post type plug-in label Sep 6, 2026
@rmdes rmdes self-assigned this Sep 6, 2026
@rmdes rmdes added this to the v1.0 milestone Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin-post-type Post type plug-in

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a page post type for undated pages such as /about and /now

1 participant