No description
  • JavaScript 71.2%
  • Nunjucks 28.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ricardo e5815b51d4 fix: layout-width hint no longer promises a nonexistent configurable default
'your site's configured default' implied a settings screen that was never
built (site-config's layout subtree was removed in v3) — 'Site default'
is the theme's standard layout. Reworded to say exactly that. The
configurable per-type default remains parked with an explicit trigger.
2026-07-25 20:08:04 +02:00
assets Initial commit: fork of @indiekit/endpoint-posts with syndicate form fix 2026-01-31 16:50:18 +01:00
includes feat: enable category typeahead on the post form (Category Governance L1) 2026-06-20 16:15:03 +02:00
lib feat: empty-delete guard + i18n for layout-intent 2026-06-16 23:15:17 +02:00
locales fix: layout-width hint no longer promises a nonexistent configurable default 2026-07-25 20:08:04 +02:00
views feat: replace dead layout select with semantic layout-intent enum 2026-06-16 19:38:21 +02:00
.gitignore Initial commit: fork of @indiekit/endpoint-posts with syndicate form fix 2026-01-31 16:50:18 +01:00
CHANGELOG.md Initial commit: fork of @indiekit/endpoint-posts with syndicate form fix 2026-01-31 16:50:18 +01:00
CLAUDE.md docs: document syndicator error hardening, adopt version-in-package.json policy 2026-06-10 22:16:11 +02:00
index.js feat: add mass purge for soft-deleted posts 2026-03-17 19:33:39 +01:00
package.json fix: layout-width hint no longer promises a nonexistent configurable default 2026-07-25 20:08:04 +02:00
README.md feat: add filtering, search, and sorting to posts listing 2026-02-13 17:33:39 +01:00

@rmdes/indiekit-endpoint-posts

Post management endpoint for Indiekit. View, create, edit, and delete posts published through your Micropub endpoint.

Fork Notice

This is a fork of @indiekit/endpoint-posts with three critical bug fixes:

1. Syndication Form Bug Fix (CRITICAL)

The syndicate button was using data.url for the source_url value, but data is never defined in the template context. The controller passes properties, not data. This caused syndication to fail or syndicate the wrong post.

Fixed: Changed value: data.url to value: properties.url in includes/@indiekit-endpoint-posts-syndicate.njk

PR submitted upstream: https://github.com/getindiekit/indiekit/pull/828

2. MongoDB Query Performance Fix

The original getPostProperties() function queried the Micropub endpoint without any filter (q=source), fetching only the first 40 posts and searching through them client-side. This made posts older than 40 items completely inaccessible, causing 404 errors when trying to view or edit them.

Fixed: Now queries the MongoDB database directly by _id, which is efficient and works regardless of how many posts exist.

3. BSON Version Conflict Fix

Using ObjectId from the MongoDB driver caused BSON version conflicts between Indiekit's MongoDB version and plugin dependencies, resulting in runtime errors.

Fixed: Use aggregation pipeline with $toString to compare _id as string, avoiding the need to import ObjectId.

Installation

npm install @rmdes/indiekit-endpoint-posts

Add to your package.json:

{
  "overrides": {
    "@indiekit/endpoint-posts": "npm:@rmdes/indiekit-endpoint-posts@^1.0.0-beta.25"
  }
}

This replaces the upstream package with this fork automatically, without changing your plugin configuration.

Usage

import PostsEndpoint from "@rmdes/indiekit-endpoint-posts";

export default {
  plugins: [
    new PostsEndpoint({
      mountPath: "/posts",  // Optional, default: "/posts"
    }),
  ],
};

Features

  • List posts with cursor-based pagination
  • View post details with status badges and syndication info
  • Create posts with dynamic forms based on post type
  • Edit posts with all properties and advanced options
  • Delete/undelete posts with confirmation
  • Syndicate posts to configured targets via button
  • Multi-language support (14 languages)
  • Draft mode for unpublished posts
  • Media uploads (audio, photo, video)
  • Scheduled publishing with timezone support
  • Multi-channel publishing (if configured)
  • Geographic coordinates (ISO 6709 format)

Options

Option Type Description
mountPath string Path to management interface. Optional, defaults to /posts.

Differences from Upstream

  1. Syndicate form uses correct variable (properties.url instead of data.url)
  2. Posts are queried directly from MongoDB (not via Micropub endpoint)
  3. No BSON version dependency (uses aggregation with string comparison)
  • @rmdes/indiekit-endpoint-micropub: Posts are created/updated/deleted via Micropub
  • @rmdes/indiekit-endpoint-syndicate: Receives syndicate button POSTs
  • Post type plugins: Define fields and validation for each post type (note, article, etc.)

Documentation

See CLAUDE.md for comprehensive technical reference, including:

  • Complete architecture overview
  • File-by-file documentation
  • Data flow diagrams
  • Configuration examples
  • Inter-plugin relationships
  • Known gotchas and workarounds

License

MIT - Original work by Paul Robert Lloyd, bug fixes by Ricardo Mendes.