Repository navigation
Link files the site doesn't publish to the repository host #361
jasonkuhrt
started this conversation in
Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Proposal
Summary
In docs written for GitHub, a relative link to source code, or to Markdown outside the collection, stays as written and 404s on the site. Let a
{path}pattern, likeeditPattern, turn it into a link to that file on the repository host.Problem & motivation
Docs written for GitHub link to the repository's other files all the time: the code a page explains, a readme above the docs folder. #253 settled that such a link "stays as written, and the build warns so you can point it at a page or a full URL", and
content-sources-plain-markdown.test.tspins it for thegotrepository's shape:../readme.md#documentationstays as written. A full GitHub URL works, but hard-codes the repository and ref into the Markdown. A relative link follows the branch being viewed on GitHub. Nimbus already builds a host URL from a file's{path}, for edit links.On
@cloudflare/nimbus-docs@0.19.4, a Git source withpath: "docs":docs/guide.md"https://github.com/acme/sdk/blob/{ref}/{path}"../readme.md#documentationhttps://github.com/acme/sdk/blob/<ref>/readme.md#documentation../src/index.tshttps://github.com/acme/sdk/blob/<ref>/src/index.tsGoals
Non-goals
Example
filePatternis a placeholder name. The site's owneditPatternwould get the same sibling, for local folders.Related: #358, and #359 for a Markdown file a collection's
patternexcludes.Which layer? (best guess — "unsure" is fine)
Framework (@cloudflare/nimbus-docs — behavior/plumbing)
All reactions