Skip to content

fix(docs-builder): copy media/docs into dist so ../media/docs images resolve (closes #2039)#2056

Open
ther12k wants to merge 2 commits into
callumalpass:mainfrom
ther12k:fix/issue-2039-docs-media-docs-images
Open

fix(docs-builder): copy media/docs into dist so ../media/docs images resolve (closes #2039)#2056
ther12k wants to merge 2 commits into
callumalpass:mainfrom
ther12k:fix/issue-2039-docs-media-docs-images

Conversation

@ther12k

@ther12k ther12k commented Jun 21, 2026

Copy link
Copy Markdown

Fixes #2039.

Root cause
Top-level markdown files (docs/workflows.md, docs/calendar-setup.md) reference images with relative paths like ../media/docs/workflow-quick-add-calendar.png. The build's resolveAssetPaths rewrites these to absolute URL paths (/media/docs/workflow-quick-add-calendar.png) so they work regardless of the published page URL.

However the build only copies docs/assets/ to dist/assets/. The media/docs/ directory was never copied to dist/media/docs/, so the rewritten absolute URLs 404 on the published site even though the source PNGs exist in the repo.

Fix
In docs-builder/build.js, after the existing docs/assets/dist/assets/ copy step, also copy media/docs/ to dist/media/docs/. This matches the URL prefix the image-source rewriter emits.

Verification

  • node build.js produces dist/media/docs/workflow-quick-add-calendar.png and dist/media/docs/settings-integrations-calendar.png (both source files exist in the repo).
  • dist/workflows/index.html emits <img src="/media/docs/workflow-quick-add-calendar.png">.
  • dist/calendar-setup/index.html emits the matching src for settings-integrations-calendar.png.
  • The docs/assets/ copy step is unchanged (still 50 items in dist/assets/).

Scope
Scoped to #2039 only. Independent from #2051 (#2046), #2052 (#2045), #2053 (#2040), #2055 (#2043).

Refs #2039.

ther12k added 2 commits June 21, 2026 17:28
…on + map filter (closes callumalpass#2043)

The default-relationships Subtasks filter generated by
formatProjectEntryLinkExpression in defaultBasesFiles.ts emits:
  file.hasLink(this.file) && list(note.PROP).map(<link-normalizer>).asLink()).contains(this.file.asLink())

The currentFileContainsMatch regex captures the entire conjunction as the
property expression. normalizeFilterProperty then sees:
  file.hasLink(this.file) && list(note.projects).map(...).asLink())
which fails every check (no leading 'list(' since the string starts with
'file.hasLink', no trailing match for the core field set, etc.) and
returns null. Net effect: clicking the column '+' button on the default
Subtasks tab creates a task with no 'projects' field, which then fails the
view filter and disappears.

Fix: strip the &&-joined left side and the generated .map(...) wrapper
(balanced-paren walk, since .asLink() lives inside the .map argument) before
the existing list()/note-prefix recognition runs.

Tests:
  - 3 new regression tests in basesFilterDefaults.test.ts covering the
    generated core-field case, the user-defined-field case, and the
    missing-current-file-link fallback.
  - All 6/6 tests in basesFilterDefaults.test.ts pass.
  - All 13/13 tests across kanbanCreationDefaults, basesTaskCreation,
    KanbanView.manualOrderFastPath, and basesCreateFileForView pass.

Refs: callumalpass#2043, callumalpass#1657, callumalpass#1902.
…resolve (closes callumalpass#2039)

The workflows and calendar-setup markdown files reference images with
relative paths like `../media/docs/workflow-quick-add-calendar.png`. The
build's `resolveAssetPaths` rewrites these to absolute URL paths
(`/media/docs/workflow-quick-add-calendar.png`) so they work regardless of
the published page URL.

However the build only copies `docs/assets/` to `dist/assets/`. The
`media/docs/` directory was never copied to `dist/media/docs/`, so the
rewritten absolute URLs 404 on the published site even though the source
PNGs exist in the repo.

Fix: copy `media/docs/` to `dist/media/docs/` alongside the existing
`docs/assets/` → `dist/assets/` step. This matches the URL prefix the
image-source rewriter emits.

Verified locally:
  - `node build.js` produces dist/media/docs/workflow-quick-add-calendar.png
    and dist/media/docs/settings-integrations-calendar.png.
  - dist/workflows/index.html emits <img src="/media/docs/workflow-quick-add-calendar.png">.
  - dist/calendar-setup/index.html emits the matching src.
  - docs/assets/ copy step is unchanged.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Broken image link on workflows page

1 participant