[READ-ONLY] Mirror of https://github.com/flo-bit/tiny-docs. quick setup, simple, minimalistic docs for your github project flo-bit.dev/tiny-docs/
0

Configure Feed

Select the types of activity you want to include in your feed.

update

+65 -20
+10 -19
.github/workflows/tiny-docs.yml
··· 68 68 echo "base=$BASE" >> "$GITHUB_OUTPUT" 69 69 echo "name=$NAME" >> "$GITHUB_OUTPUT" 70 70 71 - - name: Create docs/config.json if missing 72 - shell: bash 73 - run: | 74 - set -euo pipefail 75 - mkdir -p docs 76 - if [ ! -f docs/config.json ]; then 77 - SITE='${{ steps.derive.outputs.site }}' 78 - BASE='${{ steps.derive.outputs.base }}' 79 - NAME='${{ steps.derive.outputs.name }}' 71 + - name: Setup Node.js 72 + uses: actions/setup-node@v4 73 + with: 74 + node-version: 20 80 75 81 - printf '{\n "SITE": "%s",\n "BASE": "%s",\n "SITE_NAME": "%s"\n}\n' \ 82 - "$SITE" "$BASE" "$NAME" > docs/config.json 83 - 84 - echo "Created docs/config.json, site=$SITE, base=$BASE, name=$NAME" 85 - else 86 - echo "docs/config.json already exists; leaving it unchanged." 87 - fi 88 - 89 - echo "🔍 File contents:" 90 - cat docs/config.json 76 + - name: Ensure docs/config.json has required fields (merge w/ defaults) 77 + env: 78 + DERIVED_SITE: ${{ steps.derive.outputs.site }} 79 + DERIVED_BASE: ${{ steps.derive.outputs.base }} 80 + DERIVED_NAME: ${{ steps.derive.outputs.name }} 81 + run: node scripts/update-config.js 91 82 92 83 - name: Install, build, and upload the site artifact 93 84 uses: withastro/action@v3
+48
scripts/update-config.js
··· 1 + import fs from "node:fs"; 2 + 3 + const CONFIG_PATH = "docs/config.json"; 4 + 5 + // Defaults derived from workflow env 6 + const derived = { 7 + SITE: process.env.DERIVED_SITE, 8 + BASE: process.env.DERIVED_BASE, 9 + SITE_NAME: process.env.DERIVED_NAME, 10 + }; 11 + 12 + function readExisting(path) { 13 + if (!fs.existsSync(path)) return {}; 14 + try { 15 + const raw = fs.readFileSync(path, "utf8").trim() || "{}"; 16 + return JSON.parse(raw); 17 + } catch (e) { 18 + console.warn( 19 + "⚠️ Invalid JSON in docs/config.json; continuing with empty object.", 20 + ); 21 + return {}; 22 + } 23 + } 24 + 25 + function normalize(merged) { 26 + if ( 27 + typeof merged.BASE === "string" && 28 + merged.BASE && 29 + !merged.BASE.startsWith("/") 30 + ) { 31 + merged.BASE = "/" + merged.BASE; 32 + } 33 + return merged; 34 + } 35 + 36 + fs.mkdirSync("docs", { recursive: true }); 37 + const existing = readExisting(CONFIG_PATH); 38 + 39 + // Merge so existing values win; only fill in missing keys from derived 40 + const merged = normalize({ ...derived, ...existing }); 41 + 42 + fs.writeFileSync(CONFIG_PATH, JSON.stringify(merged, null, 2) + "\n"); 43 + console.log( 44 + "✅ Wrote docs/config.json with keys:", 45 + Object.keys(merged).join(", "), 46 + ); 47 + 48 + console.log("\n🔍 Result:\n" + fs.readFileSync(CONFIG_PATH, "utf8"));
+7 -1
todo.md
··· 4 4 - [x] remove numbers and docs/ folder from the urls 5 5 - edit on github link 6 6 - ally: add skip to content button 7 - - make asides github flavored markdown compatible 7 + - make asides github flavored markdown compatible 8 + - checkout tagged version of repo 9 + - fix relative links 10 + - add npx command to install either workflow or add docs-builder to your repo 11 + - option to not include readme 12 + - have readme as first doc 13 + - option to rename readme