Repository navigation
Read docs written for GitHub from a local folder the way a Git source reads them #358
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.
Uh oh!
There was an error while loading. Please reload this page.
Proposal
Summary
Give
docsCollection({ base })over a folder outsidesrc/contentwhat Docs written for GitHub gives a Git source: a page with notitletakes its first heading, and relative links between its pages become page URLs.Problem & motivation
A monorepo keeps each package's docs beside its code (
packages/<name>/README.md,packages/<name>/docs/*.md), written for GitHub. #117 asked for docs that live with their code, and #253 delivered it for Git sources, with the GitHub handling. The same docs read from the site's own repository throughbaseget neither: #253 made a folder outsidesrc/content"identical to a page undersrc/content".A source pointed at the site's own repository gets the handling, but it reads a commit snapshot, so
astro devshows an edit only after it is committed and the server restarts.The same folder read both ways, on
@cloudflare/nimbus-docs@0.19.4:pkg/docsCollection({ base: "../../../pkg" })docsCollection({ source: "pkg" })README.md:# Widget, no frontmatterMissing required "title" in frontmatterWidget[usage](./docs/usage.md)inREADME.md./docs/usage.md, a 404/docs/usage/[overview](../README.md)indocs/usage.md../README.md, a 404/readme/astro devThe
baselink rows used a copy withtitleadded, to get past the first row. The source is{ repo: "..", ref: "main", path: "pkg" }.Goals
astro dev.Non-goals
titlefor pages undersrc/content.Example
A site at
apps/docsreading every package's docs, with today's options:Whether every folder outside
src/contentgets the GitHub handling, or a collection opts in, is yours to decide.Related: #360 (a folder's
README.mdas its page), #361 (links to files the site doesn't publish), and #359 (a bug in which links become page URLs).Which layer? (best guess — "unsure" is fine)
Framework (@cloudflare/nimbus-docs — behavior/plumbing)
All reactions