← Commit history

wiki-subreadme: correct asset rule to absolute /blob/ URLs (relative breaks in Files-tab render)

John Lauer ·40c471d865 ·2mo ago ·parent 2c907b3
1 file changed +25−9
skills/wiki-subreadme/SKILL.md+25−9
@@ -48,19 +48,31 @@ So: not the main README, not a new page, not a family child page. A folder with 1. Pick a clear folder name, kebab-case, that reads as a path segment:    `september-dc-event/`, `virtual-meeting-04aug2026/`, `runbooks/oncall/`. 2. Put the doc at `<folder>/README.md`.-3. Put its assets **inside the same folder** and reference them with-   **folder-relative** paths, so the sub-page is self-contained:+3. Put its assets **inside the same folder**, but reference them with+   **ABSOLUTE blob URLs**, not relative paths. This is the trap: a sub-readme+   renders via the **Files tab** at `/<owner>/<slug>/files/<folder>`, and in that+   render a relative `img/x.jpg` resolves against the Files-tab route (a page+   URL), NOT the file blob, so **every relative image and asset link 404s**.+   (Relative paths only work in the ROOT `README.md` on the Overview tab, whose+   renderer rewrites them; the Files-tab sub-page renderer does not.)++   Use the blob endpoint, `/blob/<type>/<slug>/<repo-path>` (type is the page's+   type: `app`, `skill`, `component`, ...; no owner in a blob path):     ```    september-dc-event/-     README.md            # ![shot](img/workcell.jpg)  ->  september-dc-event/img/workcell.jpg+     README.md   # ![shot](https://wiki.adom.inc/blob/app/<slug>/september-dc-event/img/workcell.jpg)      img/workcell.jpg    virtual-meeting-04aug2026/-     README.md            # ![Slide 1](slides/slide-01.jpg) and [deck](compilation.pdf)-     slides/slide-01.jpg+     README.md   # ![Slide 1](https://wiki.adom.inc/blob/app/<slug>/virtual-meeting-04aug2026/slides/slide-01.jpg)+     slides/slide-01.jpg   # PDFs, videos, any asset: same absolute /blob/ URL      compilation.pdf    ``` +   Verify the blob URL serves the file (open it in a browser, it should show the+   raw image), then verify the rendered sub-page at+   `/<owner>/<slug>/files/<folder>` shows the images, not broken icons.+ 4. Push it through the git layer, then verify it is really there:     ```bash@@ -86,12 +98,16 @@ paths do:  ## Rules of thumb -- **Folder-relative everything.** A sub-readme should render correctly whether a-  reader opens it from the Files tree or via a direct link. Absolute-  `.../api/.../files/...?raw=1` URLs work but couple the doc to the API path,-  prefer relative.+- **Absolute `/blob/` URLs for every image and asset.** Relative paths break in+  the Files-tab render (see step 3). This is the single most common sub-readme+  mistake: the doc reads fine as raw markdown and in the root README, then every+  image is a broken icon on the actual sub-page.+- **Links to other wiki PAGES stay normal** (`https://wiki.adom.inc/<owner>/<slug>`);+  only files (images, PDFs, videos) need the `/blob/` treatment. - **One folder, one topic.** If a doc grows its own images, decks, and sub-docs,   a folder keeps it tidy and portable.+- **Verify on the rendered sub-page**, not just the raw markdown: open+  `/<owner>/<slug>/files/<folder>` and confirm the images actually load. - **Markdown only** gets the sanitizer treatment (see `wiki-readme`): prose,   images, tables, task lists. For a fully designed layout, a sub-readme can be a   `readme.html`-style file too, but plain `README.md` is the common case.