···262627273. The workflow will run automatically when you push to the main branch, after a minute or two your docs should be live at `https://<yourusername>.github.io/<yourrepo>`.
28282929-The docs will include all markdown files in the `docs/` folder of your repo as well as the `Readme.md` file.2929+The docs will include all markdown files in the `docs/` folder of your repo as well as the `Readme.md` file.
3030+3131+More:
3232+3333+- [Configuration](./docs/01-configuration.md)
3434+- [Internal links](./docs/02-internal-links.md)
3535+- [Embeds](./docs/03-embeds.md)
3636+- [Customizing](./docs/04-customizing.md)
···11+# Configuration
22+33+Add a `tdocs.config.json` file to the root of your repo to override defaults:
44+55+```json
66+{
77+ "SITE_NAME": "My Project",
88+ "SITE_DESCRIPTION": "A short description",
99+ "BASE_COLOR": "zinc",
1010+ "ACCENT_COLOR": "emerald",
1111+ "SEARCH_ENABLED": true,
1212+ "SHOW_THEME_TOGGLE": true,
1313+ "EXCLUDE_README": false,
1414+ "REPLACE_README_WITH_TITLE": "Introduction",
1515+ "GITHUB_URL": "https://github.com/you/your-repo"
1616+}
1717+```
1818+1919+All fields are optional. Socials: `TWITTER_URL`, `BLUESKY_URL`, `DISCORD_URL`, `YOUTUBE_URL`, `LINKEDIN_URL`, `FACEBOOK_URL`, `EMAIL`.
2020+2121+See [`config.type.ts`](../config.type.ts) for the full list.
2222+2323+## File ordering and categories
2424+2525+- Prefix a filename with digits + dash to control order, e.g. `01-intro.md`, `02-setup.md`. The prefix is stripped from the URL.
2626+- Put files in a subfolder to group them under a sidebar category, e.g. `docs/guide/01-install.md` → category "guide".
···11+# Internal links
22+33+Links between your markdown files need to match how tiny-docs builds URLs, or they'll 404 in the deployed site.
44+55+## The rules
66+77+- Write links to the **actual file path**, with the `.md` (or `.mdx`) extension.
88+- Paths may be relative (`./foo.md`, `../bar.md`) or absolute from the repo root (`/docs/foo.md`).
99+- Numeric prefixes (`01-`, `02-`) are stripped from the URL but must stay in the link.
1010+- All URLs are lowercased.
1111+- `README.md` maps to `/`.
1212+1313+## Examples
1414+1515+Given this layout:
1616+1717+```
1818+README.md
1919+docs/
2020+ 01-getting-started.md
2121+ guide/
2222+ 01-install.md
2323+ 02-usage.md
2424+```
2525+2626+From `docs/guide/01-install.md`:
2727+2828+```md
2929+[Getting started](../01-getting-started.md) → /docs/getting-started
3030+[Usage](./02-usage.md) → /docs/guide/usage
3131+[Home](/README.md) → /
3232+```
3333+3434+## Common pitfalls
3535+3636+- **Don't omit the extension.** `[link](../getting-started)` won't resolve — write `[link](../getting-started.md)`.
3737+- **Don't hand-craft the final URL.** Writing `[link](/docs/guide/usage)` skips the rewriter and breaks when `BASE` is set (project pages served under `/<repo>/`). Link to the file.
3838+- **Anchors work normally.** `[section](./usage.md#install)` is fine.
3939+- **External links** (starting with `http`) are left untouched and open in a new tab.
···11+# Embeds
22+33+Drop a URL on its own line, or use a `::directive{}` inside your markdown.
44+55+## Built-in
66+77+- **YouTube** — paste a youtube link, or `::youtube{#VIDEO_ID}`
88+- **GitHub repo card** — paste `https://github.com/owner/repo`
99+- **Link card** — any other URL on its own line becomes a rich link card
1010+- **Excalidraw** — paste `https://excalidraw.com/#json=...`
1111+- **Callouts** — GitHub-style `> [!NOTE]`, `> [!TIP]`, `> [!WARNING]`, `> [!CAUTION]`, `> [!IMPORTANT]`
1212+1313+## Math and code
1414+1515+- Math: `$inline$` and `$$block$$` (rendered via MathJax).
1616+- Code blocks: Shiki highlighting with `// [!code highlight]` annotations.
···11+# Customizing
22+33+For bigger changes (styling, new components, custom embeds), vendor tiny-docs into your repo as `docs-builder/`:
44+55+```bash
66+git clone --depth 1 --branch v1 https://github.com/flo-bit/tiny-docs docs-builder
77+rm -rf docs-builder/.git
88+```
99+1010+The workflow auto-detects `docs-builder/` and uses it instead of the upstream copy. Edit anything under `docs-builder/src/` and commit — your fork ships on the next push.
1111+1212+## Adding a custom component to markdown
1313+1414+1. Create a component, e.g. `docs-builder/src/embeds/my-thing/MyThing.astro`.
1515+2. Register it in `docs-builder/astro.config.ts`:
1616+1717+ ```ts
1818+ customEmbeds({
1919+ embeds: [
2020+ // ...existing
2121+ {
2222+ componentName: "MyThing",
2323+ directiveName: "mything",
2424+ importPath: "src/embeds/my-thing",
2525+ },
2626+ ],
2727+ }),
2828+ ```
2929+3030+3. Use it in any markdown file:
3131+3232+ ```md
3333+ ::mything{label="hello" count=3}
3434+ ```
3535+3636+Props on the directive are passed straight to the component. For URL-triggered embeds, add a `urlMatcher` — see [`src/embeds/youtube/embed.ts`](../src/embeds/youtube/embed.ts) for an example.
3737+3838+## Local development
3939+4040+```bash
4141+npm install
4242+npm run dev
4343+```
4444+4545+Put markdown in `docs/` and a `README.md` at the repo root, same as the deployed setup.