Skip to content

feat: add page post type - #955

Merged
paulrobertlloyd merged 1 commit into
mainfrom
feat/post-type-page
Sep 26, 2026
Merged

paulrobertlloyd merged 1 commit 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.

@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
@paulrobertlloyd
paulrobertlloyd force-pushed the feat/post-type-page branch 2 times, most recently from 37592dd to b797f16 Compare September 26, 2026 10:46
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
@paulrobertlloyd

Copy link
Copy Markdown
Collaborator

This is fantastic, thank you. Made a few changes:

  • Updated design of post type icon (I really want to update the design of all of these, but made it more consistent with the other post type icons for now)
  • Added a page icon
  • Added this plugin into the root indiekit.config.js for easier testing
  • Added your name and website to the contributors field in package.json, as seems only fair. Let me know if you want me to change that.

@paulrobertlloyd
paulrobertlloyd merged commit 8f1fdbe into main Sep 26, 2026
1 check passed
@paulrobertlloyd
paulrobertlloyd deleted the feat/post-type-page branch September 26, 2026 11:01
@rmdes

rmdes commented Sep 26, 2026

Copy link
Copy Markdown
Collaborator Author

Yay my first plugin contribution is in, I'm so happy 😁

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

2 participants