fix(docs-builder): copy media/docs into dist so ../media/docs images resolve (closes #2039)#2056
Open
ther12k wants to merge 2 commits into
Open
fix(docs-builder): copy media/docs into dist so ../media/docs images resolve (closes #2039)#2056ther12k wants to merge 2 commits into
ther12k wants to merge 2 commits into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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'sresolveAssetPathsrewrites 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/todist/assets/. Themedia/docs/directory was never copied todist/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 existingdocs/assets/→dist/assets/copy step, also copymedia/docs/todist/media/docs/. This matches the URL prefix the image-source rewriter emits.Verification
node build.jsproducesdist/media/docs/workflow-quick-add-calendar.pnganddist/media/docs/settings-integrations-calendar.png(both source files exist in the repo).dist/workflows/index.htmlemits<img src="/media/docs/workflow-quick-add-calendar.png">.dist/calendar-setup/index.htmlemits the matchingsrcforsettings-integrations-calendar.png.docs/assets/copy step is unchanged (still 50 items indist/assets/).Scope
Scoped to #2039 only. Independent from #2051 (#2046), #2052 (#2045), #2053 (#2040), #2055 (#2043).
Refs #2039.