Repository navigation
fix(collect): an embed of an attachment card draws and ships its payload - #11
Merged
adammharris merged 1 commit intoOct 20, 2026
Merged
Conversation
An `id:` reference to an attachment card resolved to the card's own source path, so `` drew a page or a YAML file and the payload never shipped. An embed of a card, by id or by a path to the sidecar, now names the payload, relative to the page, before the id rewrite runs; a plain link does the same when the card is not one of the site's pages. The reference scan then collects or withholds the payload as it does one referenced by its own path. Behavioural-change: a body embedding an attachment card (`` or ``) is collected with the reference retargeted to the payload, and the payload is shipped or withheld; a link to a card the site does not publish lands on the payload rather than the card's source path.
adammharris
deleted the
agent/backlog-an-id-embed-of-a-card-draws-its-payload
branch
October 30, 2026 01:25
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.
Closes the task
docs/tasks/an-id-embed-of-a-card-draws-its-payload.md(markedstatus: donein this branch).What changed
collect_documentshas a new step,retarget_cards, that runs after the visibility filter and beforerewrite_id_links. For each body reference that resolves to an attachment card (a localid:, a self-qualifiedid:, or a path to the sidecar), it does this:,): the reference is retargeted to the payload, written relative to the page. The locator and wrapper are kept.The existing reference scan then sees the payload's path, so the payload is shipped, or withheld when its sidecar names another audience. These are the same rules a reference by the payload's own path gets. Ids are looked up in
CollectOptions::id_by_pathread backwards. The anchor handling inpush_canonical_refmoved into a smallcanonical_targethelper that both steps share.Foreign cards (
id:<other-workspace>/<id>) are left as they were. Their payload belongs to their own workspace.Why
Before this change,
became, the card's own source path. The published<img>pointed at a page or a YAML file, and the payload was never shipped.Verification
an_embed_of_a_card_draws_its_payload: by id and by path, card published and unpublisheda_link_to_a_card_lands_on_its_page_or_else_its_payloadan_embed_of_a_card_for_another_audience_is_withheldship cipasses all jobs locally: fmt, clippy-D warnings, tests, docs, wasm, alone, MSRV 1.88.prov check: no findings.