Skip to content

Resolve placeholder and config-driven permalinks in route derivation #13

Open

Description

@mickdarling

Deferred from PR #12 (not a showstopper; today's behavior is a documented fallback, not a regression).

Current behavior

route_for_markdown honors literal front-matter permalinks but falls back to file-path mapping when:

  • the permalink contains Jekyll placeholders (/blog/:title/, :year, etc.)
  • the route comes from config-level permalink patterns (collection permalink: settings, permalink: pretty) rather than per-file front matter

In both cases the emitted route can differ from where Jekyll actually rendered the page, producing 404s in the viewer for those files.

Structural fix

Derive routes from the RENDERED output rather than source heuristics: after the new-site build, locate each changed file's emitted page (e.g. via a tiny Jekyll hook/plugin that dumps a source→URL map, or by matching content/slug in the output tree), and use per-side maps for old/new. This subsumes placeholder expansion, config patterns, and future permalink features in one mechanism, and was the original suggestion in #10.

Also worth folding in

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions