HASH 07e5aeb63114
DATE 2026-07-18
SUBJECT web: git pages render default branch only, exclude prefixes for data dumps
FILES 12 CHANGED
HASH 07e5aeb63114
DATE 2026-07-18
SUBJECT web: git pages render default branch
only, exclude prefixes for data dumps
FILES 12 CHANGED
┌─ ooknet-design/src/components/GitListing/GitListing.astro ─────────────────┐
│ diff --git a/ooknet-design/src/components/GitListing/GitListing.astro b/ooknet-des │
│ ign/src/components/GitListing/GitListing.astro │
│ index 8c82ca8..764b70d 100644 │
│ --- a/ooknet-design/src/components/GitListing/GitListing.astro │
│ +++ b/ooknet-design/src/components/GitListing/GitListing.astro │
│ @@ -4,10 +4,12 @@ import { FRAME_W, MOBILE_FRAME_W } from "../../lib/config"; │
│ import { layoutListing, type ListingRow, type Props } from "./GitListing"; │
│ import "./GitListing.scss"; │
│ │
│ -const { entries, treeBase, blobBase, commitBase } = Astro.props as Props; │
│ +const { entries, treeBase, blobBase, commitBase, isLinked } = Astro.props as Prop │
│ s & { │
│ + isLinked?: (e: (typeof entries)[number]) => boolean; │
│ +}; │
│ const variants: [string, ListingRow[]][] = [ │
│ - ["frame-wide", layoutListing(entries, FRAME_W, treeBase, blobBase, commitBase)] │
│ , │
│ - ["frame-narrow", layoutListing(entries, MOBILE_FRAME_W, treeBase, blobBase, com │
│ mitBase)], │
│ + ["frame-wide", layoutListing(entries, FRAME_W, treeBase, blobBase, commitBase, │
│ isLinked)], │
│ + ["frame-narrow", layoutListing(entries, MOBILE_FRAME_W, treeBase, blobBase, com │
│ mitBase, isLinked)], │
│ ]; │
│ --- │
│ <div class="git-listing"> │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ...s/GitListing/GitListing.astro ───┐
│ diff --git a/ooknet-design/src/components/Gi │
│ tListing/GitListing.astro b/ooknet-design/sr │
│ c/components/GitListing/GitListing.astro │
│ index 8c82ca8..764b70d 100644 │
│ --- a/ooknet-design/src/components/GitListin │
│ g/GitListing.astro │
│ +++ b/ooknet-design/src/components/GitListin │
│ g/GitListing.astro │
│ @@ -4,10 +4,12 @@ import { FRAME_W, MOBILE_F │
│ RAME_W } from "../../lib/config"; │
│ import { layoutListing, type ListingRow, ty │
│ pe Props } from "./GitListing"; │
│ import "./GitListing.scss"; │
│ │
│ -const { entries, treeBase, blobBase, commit │
│ Base } = Astro.props as Props; │
│ +const { entries, treeBase, blobBase, commit │
│ Base, isLinked } = Astro.props as Props & { │
│ + isLinked?: (e: (typeof entries)[number]) │
│ => boolean; │
│ +}; │
│ const variants: [string, ListingRow[]][] = │
│ [ │
│ - ["frame-wide", layoutListing(entries, FRA │
│ ME_W, treeBase, blobBase, commitBase)], │
│ - ["frame-narrow", layoutListing(entries, M │
│ OBILE_FRAME_W, treeBase, blobBase, commitBas │
│ e)], │
│ + ["frame-wide", layoutListing(entries, FRA │
│ ME_W, treeBase, blobBase, commitBase, isLink │
│ ed)], │
│ + ["frame-narrow", layoutListing(entries, M │
│ OBILE_FRAME_W, treeBase, blobBase, commitBas │
│ e, isLinked)], │
│ ]; │
│ --- │
│ <div class="git-listing"> │
└──────────────────────────────────────────────┘
┌─ ooknet-design/src/components/GitListing/GitListing.ts ────────────────────┐
│ diff --git a/ooknet-design/src/components/GitListing/GitListing.ts b/ooknet-design │
│ /src/components/GitListing/GitListing.ts │
│ index e2bbc3b..da99dac 100644 │
│ --- a/ooknet-design/src/components/GitListing/GitListing.ts │
│ +++ b/ooknet-design/src/components/GitListing/GitListing.ts │
│ @@ -14,7 +14,7 @@ export interface Props { │
│ │
│ export interface ListingRow { │
│ name: string; │
│ - href: string; │
│ + href: string | null; │
│ gap1: string; │
│ subject: string; │
│ subjectHref: string; │
│ @@ -31,6 +31,7 @@ export function layoutListing( │
│ treeBase: string, │
│ blobBase: string, │
│ commitBase = "", │
│ + isLinked: (e: DirEntry) => boolean = () => true, │
│ ): ListingRow[] { │
│ const nameW = Math.min( │
│ Math.max(8, ...entries.map((e) => len(e.name) + (e.kind === "tree" ? 1 : 0))) │
│ , │
│ @@ -49,7 +50,7 @@ export function layoutListing( │
│ : e.subject; │
│ const row: ListingRow = { │
│ name, │
│ - href: `${e.kind === "tree" ? treeBase : blobBase}${e.path}/`, │
│ + href: isLinked(e) ? `${e.kind === "tree" ? treeBase : blobBase}${e.path}/` │
│ : null, │
│ gap1: " ".repeat(nameW - len(name) + GAP), │
│ subject, │
│ subjectHref: `${commitBase}${e.hash}/`, │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ...ents/GitListing/GitListing.ts ───┐
│ diff --git a/ooknet-design/src/components/Gi │
│ tListing/GitListing.ts b/ooknet-design/src/c │
│ omponents/GitListing/GitListing.ts │
│ index e2bbc3b..da99dac 100644 │
│ --- a/ooknet-design/src/components/GitListin │
│ g/GitListing.ts │
│ +++ b/ooknet-design/src/components/GitListin │
│ g/GitListing.ts │
│ @@ -14,7 +14,7 @@ export interface Props { │
│ │
│ export interface ListingRow { │
│ name: string; │
│ - href: string; │
│ + href: string | null; │
│ gap1: string; │
│ subject: string; │
│ subjectHref: string; │
│ @@ -31,6 +31,7 @@ export function layoutList │
│ ing( │
│ treeBase: string, │
│ blobBase: string, │
│ commitBase = "", │
│ + isLinked: (e: DirEntry) => boolean = () = │
│ > true, │
│ ): ListingRow[] { │
│ const nameW = Math.min( │
│ Math.max(8, ...entries.map((e) => len(e │
│ .name) + (e.kind === "tree" ? 1 : 0))), │
│ @@ -49,7 +50,7 @@ export function layoutList │
│ ing( │
│ : e.subject; │
│ const row: ListingRow = { │
│ name, │
│ - href: `${e.kind === "tree" ? treeBase │
│ : blobBase}${e.path}/`, │
│ + href: isLinked(e) ? `${e.kind === "tr │
│ ee" ? treeBase : blobBase}${e.path}/` : null │
│ , │
│ gap1: " ".repeat(nameW - len(name) + │
│ GAP), │
│ subject, │
│ subjectHref: `${commitBase}${e.hash}/ │
│ `, │
└──────────────────────────────────────────────┘
┌─ ooknet-design/src/content/kb/notes/dir.yml ───────────────────────────────┐
│ diff --git a/ooknet-design/src/content/kb/notes/dir.yml b/ooknet-design/src/conten │
│ t/kb/notes/dir.yml │
│ new file mode 100644 │
│ index 0000000..a84be74 │
│ --- /dev/null │
│ +++ b/ooknet-design/src/content/kb/notes/dir.yml │
│ @@ -0,0 +1 @@ │
│ +register: notes │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ .../src/content/kb/notes/dir.yml ───┐
│ diff --git a/ooknet-design/src/content/kb/no │
│ tes/dir.yml b/ooknet-design/src/content/kb/n │
│ otes/dir.yml │
│ new file mode 100644 │
│ index 0000000..a84be74 │
│ --- /dev/null │
│ +++ b/ooknet-design/src/content/kb/notes/dir │
│ .yml │
│ @@ -0,0 +1 @@ │
│ +register: notes │
└──────────────────────────────────────────────┘
┌─ ooknet-design/src/content/kb/notes/hello-world.md ────────────────────────┐
│ diff --git a/ooknet-design/src/content/kb/notes/hello-world.md b/ooknet-design/src │
│ /content/kb/notes/hello-world.md │
│ new file mode 100644 │
│ index 0000000..a33483e │
│ --- /dev/null │
│ +++ b/ooknet-design/src/content/kb/notes/hello-world.md │
│ @@ -0,0 +1,11 @@ │
│ +--- │
│ +title: "HELLO WORLD" │
│ +source: "MICROSOFT LEARN" │
│ +url: "https://learn.microsoft.com/en-us/troubleshoot/windows-client/performance/p │
│ erformance-overview" │
│ +retrieved: "2026-04-25" │
│ +tags: ["windows", "troubleshooting", "performance", "monitoring"] │
│ +--- │
│ + │
│ +# H │
│ + │
│ +ello world! │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ...ntent/kb/notes/hello-world.md ───┐
│ diff --git a/ooknet-design/src/content/kb/no │
│ tes/hello-world.md b/ooknet-design/src/conte │
│ nt/kb/notes/hello-world.md │
│ new file mode 100644 │
│ index 0000000..a33483e │
│ --- /dev/null │
│ +++ b/ooknet-design/src/content/kb/notes/hel │
│ lo-world.md │
│ @@ -0,0 +1,11 @@ │
│ +--- │
│ +title: "HELLO WORLD" │
│ +source: "MICROSOFT LEARN" │
│ +url: "https://learn.microsoft.com/en-us/tro │
│ ubleshoot/windows-client/performance/perform │
│ ance-overview" │
│ +retrieved: "2026-04-25" │
│ +tags: ["windows", "troubleshooting", "perfo │
│ rmance", "monitoring"] │
│ +--- │
│ + │
│ +# H │
│ + │
│ +ello world! │
└──────────────────────────────────────────────┘
┌─ ooknet-design/src/git.config.ts ──────────────────────────────────────────┐
│ diff --git a/ooknet-design/src/git.config.ts b/ooknet-design/src/git.config.ts │
│ index c58a013..ac49f11 100644 │
│ --- a/ooknet-design/src/git.config.ts │
│ +++ b/ooknet-design/src/git.config.ts │
│ @@ -29,5 +29,6 @@ export const REPOS: GitRepo[] = [ │
│ path: at("wowsim-stats", "../../wowsim-stats"), │
│ desc: "a nix pipeline that orchestrates mist of pandaria simulations at scale │
│ , and a statically generated challenge mode leaderboard", │
│ clone: "https://git.ooknet.org/ooks/wowsim-stats.git", │
│ + exclude: ["web/public/data"], │
│ }, │
│ ]; │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ooknet-design/src/git.config.ts ────┐
│ diff --git a/ooknet-design/src/git.config.ts │
│ b/ooknet-design/src/git.config.ts │
│ index c58a013..ac49f11 100644 │
│ --- a/ooknet-design/src/git.config.ts │
│ +++ b/ooknet-design/src/git.config.ts │
│ @@ -29,5 +29,6 @@ export const REPOS: GitRep │
│ o[] = [ │
│ path: at("wowsim-stats", "../../wowsim- │
│ stats"), │
│ desc: "a nix pipeline that orchestrates │
│ mist of pandaria simulations at scale, and │
│ a statically generated challenge mode leader │
│ board", │
│ clone: "https://git.ooknet.org/ooks/wow │
│ sim-stats.git", │
│ + exclude: ["web/public/data"], │
│ }, │
│ ]; │
└──────────────────────────────────────────────┘
┌─ ooknet-design/src/lib/git.test.ts ────────────────────────────────────────┐
│ diff --git a/ooknet-design/src/lib/git.test.ts b/ooknet-design/src/lib/git.test.ts │
│ index 8672894..67ce014 100644 │
│ --- a/ooknet-design/src/lib/git.test.ts │
│ +++ b/ooknet-design/src/lib/git.test.ts │
│ @@ -1,5 +1,5 @@ │
│ import { describe, expect, it } from "vitest"; │
│ -import { branches, langOf, repoAvailable, repoInfo } from "./git"; │
│ +import { branches, excluded, langOf, repoAvailable, repoInfo } from "./git"; │
│ import { toGrid } from "./ascii"; │
│ │
│ describe("toGrid", () => { │
│ @@ -17,6 +17,16 @@ describe("toGrid", () => { │
│ }); │
│ }); │
│ │
│ +describe("excluded", () => { │
│ + const r = { slug: "x", name: "x", path: "..", desc: "", exclude: ["web/public/d │
│ ata"] }; │
│ + it("matches the prefix and below, nothing else", () => { │
│ + expect(excluded(r, "web/public/data")).toBe(true); │
│ + expect(excluded(r, "web/public/data/a/b.json")).toBe(true); │
│ + expect(excluded(r, "web/public/database.ts")).toBe(false); │
│ + expect(excluded({ ...r, exclude: undefined }, "web/public/data")).toBe(false) │
│ ; │
│ + }); │
│ +}); │
│ + │
│ describe("langOf", () => { │
│ it("maps extensions to frame labels", () => { │
│ expect(langOf("src/lib/ascii.ts")).toBe("TS"); │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ...et-design/src/lib/git.test.ts ───┐
│ diff --git a/ooknet-design/src/lib/git.test. │
│ ts b/ooknet-design/src/lib/git.test.ts │
│ index 8672894..67ce014 100644 │
│ --- a/ooknet-design/src/lib/git.test.ts │
│ +++ b/ooknet-design/src/lib/git.test.ts │
│ @@ -1,5 +1,5 @@ │
│ import { describe, expect, it } from "vites │
│ t"; │
│ -import { branches, langOf, repoAvailable, r │
│ epoInfo } from "./git"; │
│ +import { branches, excluded, langOf, repoAv │
│ ailable, repoInfo } from "./git"; │
│ import { toGrid } from "./ascii"; │
│ │
│ describe("toGrid", () => { │
│ @@ -17,6 +17,16 @@ describe("toGrid", () => │
│ { │
│ }); │
│ }); │
│ │
│ +describe("excluded", () => { │
│ + const r = { slug: "x", name: "x", path: " │
│ ..", desc: "", exclude: ["web/public/data"] │
│ }; │
│ + it("matches the prefix and below, nothing │
│ else", () => { │
│ + expect(excluded(r, "web/public/data")). │
│ toBe(true); │
│ + expect(excluded(r, "web/public/data/a/b │
│ .json")).toBe(true); │
│ + expect(excluded(r, "web/public/database │
│ .ts")).toBe(false); │
│ + expect(excluded({ ...r, exclude: undefi │
│ ned }, "web/public/data")).toBe(false); │
│ + }); │
│ +}); │
│ + │
│ describe("langOf", () => { │
│ it("maps extensions to frame labels", () │
│ => { │
│ expect(langOf("src/lib/ascii.ts")).toBe │
│ ("TS"); │
└──────────────────────────────────────────────┘
┌─ ooknet-design/src/lib/git.ts ─────────────────────────────────────────────┐
│ diff --git a/ooknet-design/src/lib/git.ts b/ooknet-design/src/lib/git.ts │
│ index 7e388d7..2fc0879 100644 │
│ --- a/ooknet-design/src/lib/git.ts │
│ +++ b/ooknet-design/src/lib/git.ts │
│ @@ -18,6 +18,9 @@ export interface GitRepo { │
│ path: string; │
│ desc: string; │
│ clone?: string; │
│ + /** Path prefixes that get no blob/history pages - committed data │
│ + * dumps would explode the page count. Listed but unlinked. */ │
│ + exclude?: string[]; │
│ } │
│ │
│ const MAX_BLOB = 200 * 1024; │
│ @@ -30,6 +33,10 @@ const git = (path: string, args: string[]): string => │
│ │
│ export const repoAvailable = (r: GitRepo): boolean => existsSync(r.path); │
│ │
│ +/** True when a path sits under one of the repo's excluded prefixes. */ │
│ +export const excluded = (r: GitRepo, path: string): boolean => │
│ + (r.exclude ?? []).some((p) => path === p || path.startsWith(p + "/")); │
│ + │
│ /** Local branches, default branch first. */ │
│ export function branches(path: string): string[] { │
│ const head = defaultBranch(path); │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ooknet-design/src/lib/git.ts ───────┐
│ diff --git a/ooknet-design/src/lib/git.ts b/ │
│ ooknet-design/src/lib/git.ts │
│ index 7e388d7..2fc0879 100644 │
│ --- a/ooknet-design/src/lib/git.ts │
│ +++ b/ooknet-design/src/lib/git.ts │
│ @@ -18,6 +18,9 @@ export interface GitRepo { │
│ path: string; │
│ desc: string; │
│ clone?: string; │
│ + /** Path prefixes that get no blob/histor │
│ y pages - committed data │
│ + * dumps would explode the page count. L │
│ isted but unlinked. */ │
│ + exclude?: string[]; │
│ } │
│ │
│ const MAX_BLOB = 200 * 1024; │
│ @@ -30,6 +33,10 @@ const git = (path: string │
│ , args: string[]): string => │
│ │
│ export const repoAvailable = (r: GitRepo): │
│ boolean => existsSync(r.path); │
│ │
│ +/** True when a path sits under one of the │
│ repo's excluded prefixes. */ │
│ +export const excluded = (r: GitRepo, path: │
│ string): boolean => │
│ + (r.exclude ?? []).some((p) => path === p │
│ || path.startsWith(p + "/")); │
│ + │
│ /** Local branches, default branch first. * │
│ / │
│ export function branches(path: string): str │
│ ing[] { │
│ const head = defaultBranch(path); │
└──────────────────────────────────────────────┘
┌─ ooknet-design/src/pages/git/[repo]/blob/[...rest].astro ──────────────────┐
│ diff --git a/ooknet-design/src/pages/git/[repo]/blob/[...rest].astro b/ooknet-desi │
│ gn/src/pages/git/[repo]/blob/[...rest].astro │
│ index 34d8762..1b9fda3 100644 │
│ --- a/ooknet-design/src/pages/git/[repo]/blob/[...rest].astro │
│ +++ b/ooknet-design/src/pages/git/[repo]/blob/[...rest].astro │
│ @@ -9,12 +9,12 @@ import Button from "../../../../components/Button/Button.astro"; │
│ import ArticleFooter from "../../../../components/ArticleFooter/ArticleFooter.ast │
│ ro"; │
│ import { toGrid } from "../../../../lib/ascii"; │
│ import { REPOS } from "../../../../git.config"; │
│ -import { repoAvailable, branches, repoFiles, readBlob, langOf, type GitRepo } fro │
│ m "../../../../lib/git"; │
│ +import { repoAvailable, defaultBranch, excluded, repoFiles, readBlob, langOf, typ │
│ e GitRepo } from "../../../../lib/git"; │
│ │
│ export function getStaticPaths() { │
│ return REPOS.filter(repoAvailable).flatMap((r) => │
│ - branches(r.path).flatMap((branch) => │
│ - repoFiles(r.path, branch).map((file) => ({ │
│ + [defaultBranch(r.path)].flatMap((branch) => │
│ + repoFiles(r.path, branch).filter((f) => !excluded(r, f)).map((file) => ({ │
│ params: { repo: r.slug, rest: `${branch}/${file}` }, │
│ props: { repo: r, branch, file }, │
│ })), │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ...t/[repo]/blob/[...rest].astro ───┐
│ diff --git a/ooknet-design/src/pages/git/[re │
│ po]/blob/[...rest].astro b/ooknet-design/src │
│ /pages/git/[repo]/blob/[...rest].astro │
│ index 34d8762..1b9fda3 100644 │
│ --- a/ooknet-design/src/pages/git/[repo]/blo │
│ b/[...rest].astro │
│ +++ b/ooknet-design/src/pages/git/[repo]/blo │
│ b/[...rest].astro │
│ @@ -9,12 +9,12 @@ import Button from "../../ │
│ ../../components/Button/Button.astro"; │
│ import ArticleFooter from "../../../../comp │
│ onents/ArticleFooter/ArticleFooter.astro"; │
│ import { toGrid } from "../../../../lib/asc │
│ ii"; │
│ import { REPOS } from "../../../../git.conf │
│ ig"; │
│ -import { repoAvailable, branches, repoFiles │
│ , readBlob, langOf, type GitRepo } from "../ │
│ ../../../lib/git"; │
│ +import { repoAvailable, defaultBranch, excl │
│ uded, repoFiles, readBlob, langOf, type GitR │
│ epo } from "../../../../lib/git"; │
│ │
│ export function getStaticPaths() { │
│ return REPOS.filter(repoAvailable).flatMa │
│ p((r) => │
│ - branches(r.path).flatMap((branch) => │
│ - repoFiles(r.path, branch).map((file) │
│ => ({ │
│ + [defaultBranch(r.path)].flatMap((branch │
│ ) => │
│ + repoFiles(r.path, branch).filter((f) │
│ => !excluded(r, f)).map((file) => ({ │
│ params: { repo: r.slug, rest: `${br │
│ anch}/${file}` }, │
│ props: { repo: r, branch, file }, │
│ })), │
└──────────────────────────────────────────────┘
┌─ ooknet-design/src/pages/git/[repo]/history/[...rest].astro ───────────────┐
│ diff --git a/ooknet-design/src/pages/git/[repo]/history/[...rest].astro b/ooknet-d │
│ esign/src/pages/git/[repo]/history/[...rest].astro │
│ index 28fc3cf..4e4ff03 100644 │
│ --- a/ooknet-design/src/pages/git/[repo]/history/[...rest].astro │
│ +++ b/ooknet-design/src/pages/git/[repo]/history/[...rest].astro │
│ @@ -8,12 +8,12 @@ import Timeline from "../../../../components/Timeline/Timeline.a │
│ stro"; │
│ import Button from "../../../../components/Button/Button.astro"; │
│ import ArticleFooter from "../../../../components/ArticleFooter/ArticleFooter.ast │
│ ro"; │
│ import { REPOS } from "../../../../git.config"; │
│ -import { repoAvailable, branches, repoFiles, pathLog, type GitRepo } from "../../ │
│ ../../lib/git"; │
│ +import { repoAvailable, defaultBranch, excluded, repoFiles, pathLog, type GitRepo │
│ } from "../../../../lib/git"; │
│ │
│ export function getStaticPaths() { │
│ return REPOS.filter(repoAvailable).flatMap((r) => │
│ - branches(r.path).flatMap((branch) => │
│ - repoFiles(r.path, branch).map((file) => ({ │
│ + [defaultBranch(r.path)].flatMap((branch) => │
│ + repoFiles(r.path, branch).filter((f) => !excluded(r, f)).map((file) => ({ │
│ params: { repo: r.slug, rest: `${branch}/${file}` }, │
│ props: { repo: r, branch, file }, │
│ })), │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ...repo]/history/[...rest].astro ───┐
│ diff --git a/ooknet-design/src/pages/git/[re │
│ po]/history/[...rest].astro b/ooknet-design/ │
│ src/pages/git/[repo]/history/[...rest].astro │
│ index 28fc3cf..4e4ff03 100644 │
│ --- a/ooknet-design/src/pages/git/[repo]/his │
│ tory/[...rest].astro │
│ +++ b/ooknet-design/src/pages/git/[repo]/his │
│ tory/[...rest].astro │
│ @@ -8,12 +8,12 @@ import Timeline from "../. │
│ ./../../components/Timeline/Timeline.astro"; │
│ import Button from "../../../../components/ │
│ Button/Button.astro"; │
│ import ArticleFooter from "../../../../comp │
│ onents/ArticleFooter/ArticleFooter.astro"; │
│ import { REPOS } from "../../../../git.conf │
│ ig"; │
│ -import { repoAvailable, branches, repoFiles │
│ , pathLog, type GitRepo } from "../../../../ │
│ lib/git"; │
│ +import { repoAvailable, defaultBranch, excl │
│ uded, repoFiles, pathLog, type GitRepo } fro │
│ m "../../../../lib/git"; │
│ │
│ export function getStaticPaths() { │
│ return REPOS.filter(repoAvailable).flatMa │
│ p((r) => │
│ - branches(r.path).flatMap((branch) => │
│ - repoFiles(r.path, branch).map((file) │
│ => ({ │
│ + [defaultBranch(r.path)].flatMap((branch │
│ ) => │
│ + repoFiles(r.path, branch).filter((f) │
│ => !excluded(r, f)).map((file) => ({ │
│ params: { repo: r.slug, rest: `${br │
│ anch}/${file}` }, │
│ props: { repo: r, branch, file }, │
│ })), │
└──────────────────────────────────────────────┘
┌─ ooknet-design/src/pages/git/[repo]/index.astro ───────────────────────────┐
│ diff --git a/ooknet-design/src/pages/git/[repo]/index.astro b/ooknet-design/src/pa │
│ ges/git/[repo]/index.astro │
│ index 84a8dbe..ba0a270 100644 │
│ --- a/ooknet-design/src/pages/git/[repo]/index.astro │
│ +++ b/ooknet-design/src/pages/git/[repo]/index.astro │
│ @@ -14,7 +14,7 @@ import { len, row2, ruleD } from "../../../lib/ascii"; │
│ import { FRAME_W, MOBILE_FRAME_W } from "../../../lib/config"; │
│ import { renderMarkdown } from "../../../lib/markdown"; │
│ import { REPOS } from "../../../git.config"; │
│ -import { repoAvailable, repoInfo, branches, dirEntries, repoLog, readReadme, type │
│ GitRepo } from "../../../lib/git"; │
│ +import { repoAvailable, repoInfo, excluded, dirEntries, repoLog, readReadme, type │
│ GitRepo } from "../../../lib/git"; │
│ │
│ export function getStaticPaths() { │
│ return REPOS.filter(repoAvailable).map((r) => ({ │
│ @@ -26,7 +26,6 @@ export function getStaticPaths() { │
│ const { repo } = Astro.props as { repo: GitRepo }; │
│ const info = repoInfo(repo.path); │
│ const branch = info.branch; │
│ -const allBranches = branches(repo.path); │
│ const entries = dirEntries(repo.path, "", branch); │
│ const log = repoLog(repo.path, 5, `/git/${repo.slug}/`, branch); │
│ const readme = readReadme(repo.path, branch); │
│ @@ -63,10 +62,7 @@ const variants: [string, number][] = [ │
│ ))} │
│ <Frame build={(w) => ruleD(w)} /> │
│ <Pre>{" "}</Pre> │
│ - <Pre><Menu label={`BRANCH: ${branch}`} items={allBranches.map((b) => ({ │
│ - label: b, │
│ - href: b === branch ? `/git/${repo.slug}/` : `/git/${repo.slug}/tree/${b}/`, │
│ - }))} /></Pre> │
│ + <Pre><Menu label={`BRANCH: ${branch}`} items={[{ label: branch, href: `/git/${r │
│ epo.slug}/` }]} /></Pre> │
│ <Pre>{" "}</Pre> │
│ {variants.map(([cls, w]) => { │
│ const r = recentRow(w); │
│ @@ -78,7 +74,8 @@ const variants: [string, number][] = [ │
│ <GitListing entries={entries} │
│ treeBase={`/git/${repo.slug}/tree/${branch}/`} │
│ blobBase={`/git/${repo.slug}/blob/${branch}/`} │
│ - commitBase={`/git/${repo.slug}/commit/`} /> │
│ + commitBase={`/git/${repo.slug}/commit/`} │
│ + isLinked={(e) => !excluded(repo, e.path)} /> │
│ <Pre>{" "}</Pre> │
│ │
│ {readmeHtml && ( │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ .../pages/git/[repo]/index.astro ───┐
│ diff --git a/ooknet-design/src/pages/git/[re │
│ po]/index.astro b/ooknet-design/src/pages/gi │
│ t/[repo]/index.astro │
│ index 84a8dbe..ba0a270 100644 │
│ --- a/ooknet-design/src/pages/git/[repo]/ind │
│ ex.astro │
│ +++ b/ooknet-design/src/pages/git/[repo]/ind │
│ ex.astro │
│ @@ -14,7 +14,7 @@ import { len, row2, ruleD │
│ } from "../../../lib/ascii"; │
│ import { FRAME_W, MOBILE_FRAME_W } from ".. │
│ /../../lib/config"; │
│ import { renderMarkdown } from "../../../li │
│ b/markdown"; │
│ import { REPOS } from "../../../git.config" │
│ ; │
│ -import { repoAvailable, repoInfo, branches, │
│ dirEntries, repoLog, readReadme, type GitRe │
│ po } from "../../../lib/git"; │
│ +import { repoAvailable, repoInfo, excluded, │
│ dirEntries, repoLog, readReadme, type GitRe │
│ po } from "../../../lib/git"; │
│ │
│ export function getStaticPaths() { │
│ return REPOS.filter(repoAvailable).map((r │
│ ) => ({ │
│ @@ -26,7 +26,6 @@ export function getStaticP │
│ aths() { │
│ const { repo } = Astro.props as { repo: Git │
│ Repo }; │
│ const info = repoInfo(repo.path); │
│ const branch = info.branch; │
│ -const allBranches = branches(repo.path); │
│ const entries = dirEntries(repo.path, "", b │
│ ranch); │
│ const log = repoLog(repo.path, 5, `/git/${r │
│ epo.slug}/`, branch); │
│ const readme = readReadme(repo.path, branch │
│ ); │
│ @@ -63,10 +62,7 @@ const variants: [string, │
│ number][] = [ │
│ ))} │
│ <Frame build={(w) => ruleD(w)} /> │
│ <Pre>{" "}</Pre> │
│ - <Pre><Menu label={`BRANCH: ${branch}`} it │
│ ems={allBranches.map((b) => ({ │
│ - label: b, │
│ - href: b === branch ? `/git/${repo.slug} │
│ /` : `/git/${repo.slug}/tree/${b}/`, │
│ - }))} /></Pre> │
│ + <Pre><Menu label={`BRANCH: ${branch}`} it │
│ ems={[{ label: branch, href: `/git/${repo.sl │
│ ug}/` }]} /></Pre> │
│ <Pre>{" "}</Pre> │
│ {variants.map(([cls, w]) => { │
│ const r = recentRow(w); │
│ @@ -78,7 +74,8 @@ const variants: [string, n │
│ umber][] = [ │
│ <GitListing entries={entries} │
│ treeBase={`/git/${repo.slug}/tree/${bra │
│ nch}/`} │
│ blobBase={`/git/${repo.slug}/blob/${bra │
│ nch}/`} │
│ - commitBase={`/git/${repo.slug}/commit/` │
│ } /> │
│ + commitBase={`/git/${repo.slug}/commit/` │
│ } │
│ + isLinked={(e) => !excluded(repo, e.path │
│ )} /> │
│ <Pre>{" "}</Pre> │
│ │
│ {readmeHtml && ( │
└──────────────────────────────────────────────┘
┌─ ooknet-design/src/pages/git/[repo]/log/[...branch].astro ─────────────────┐
│ diff --git a/ooknet-design/src/pages/git/[repo]/log/[...branch].astro b/ooknet-des │
│ ign/src/pages/git/[repo]/log/[...branch].astro │
│ index 4e3363c..027fd20 100644 │
│ --- a/ooknet-design/src/pages/git/[repo]/log/[...branch].astro │
│ +++ b/ooknet-design/src/pages/git/[repo]/log/[...branch].astro │
│ @@ -9,11 +9,11 @@ import Button from "../../../../components/Button/Button.astro"; │
│ import ArticleFooter from "../../../../components/ArticleFooter/ArticleFooter.ast │
│ ro"; │
│ import { row2, ruleD } from "../../../../lib/ascii"; │
│ import { REPOS } from "../../../../git.config"; │
│ -import { repoAvailable, branches, defaultBranch, repoInfo, repoLog, type GitRepo │
│ } from "../../../../lib/git"; │
│ +import { repoAvailable, defaultBranch, repoInfo, repoLog, type GitRepo } from ".. │
│ /../../../lib/git"; │
│ │
│ export function getStaticPaths() { │
│ return REPOS.filter(repoAvailable).flatMap((r) => │
│ - branches(r.path).map((branch) => ({ │
│ + [defaultBranch(r.path)].map((branch) => ({ │
│ params: { repo: r.slug, branch }, │
│ props: { repo: r, branch }, │
│ })), │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ .../[repo]/log/[...branch].astro ───┐
│ diff --git a/ooknet-design/src/pages/git/[re │
│ po]/log/[...branch].astro b/ooknet-design/sr │
│ c/pages/git/[repo]/log/[...branch].astro │
│ index 4e3363c..027fd20 100644 │
│ --- a/ooknet-design/src/pages/git/[repo]/log │
│ /[...branch].astro │
│ +++ b/ooknet-design/src/pages/git/[repo]/log │
│ /[...branch].astro │
│ @@ -9,11 +9,11 @@ import Button from "../../ │
│ ../../components/Button/Button.astro"; │
│ import ArticleFooter from "../../../../comp │
│ onents/ArticleFooter/ArticleFooter.astro"; │
│ import { row2, ruleD } from "../../../../li │
│ b/ascii"; │
│ import { REPOS } from "../../../../git.conf │
│ ig"; │
│ -import { repoAvailable, branches, defaultBr │
│ anch, repoInfo, repoLog, type GitRepo } from │
│ "../../../../lib/git"; │
│ +import { repoAvailable, defaultBranch, repo │
│ Info, repoLog, type GitRepo } from "../../.. │
│ /../lib/git"; │
│ │
│ export function getStaticPaths() { │
│ return REPOS.filter(repoAvailable).flatMa │
│ p((r) => │
│ - branches(r.path).map((branch) => ({ │
│ + [defaultBranch(r.path)].map((branch) => │
│ ({ │
│ params: { repo: r.slug, branch }, │
│ props: { repo: r, branch }, │
│ })), │
└──────────────────────────────────────────────┘
┌─ ooknet-design/src/pages/git/[repo]/tree/[...rest].astro ──────────────────┐
│ diff --git a/ooknet-design/src/pages/git/[repo]/tree/[...rest].astro b/ooknet-desi │
│ gn/src/pages/git/[repo]/tree/[...rest].astro │
│ index 64f5007..1495885 100644 │
│ --- a/ooknet-design/src/pages/git/[repo]/tree/[...rest].astro │
│ +++ b/ooknet-design/src/pages/git/[repo]/tree/[...rest].astro │
│ @@ -14,13 +14,13 @@ import Button from "../../../../components/Button/Button.astro │
│ "; │
│ import ArticleFooter from "../../../../components/ArticleFooter/ArticleFooter.ast │
│ ro"; │
│ import { row2, ruleD } from "../../../../lib/ascii"; │
│ import { REPOS } from "../../../../git.config"; │
│ -import { repoAvailable, branches, defaultBranch, repoFiles, repoDirs, dirEntries, │
│ type GitRepo } from "../../../../lib/git"; │
│ +import { repoAvailable, defaultBranch, excluded, repoFiles, repoDirs, dirEntries, │
│ type GitRepo } from "../../../../lib/git"; │
│ │
│ export function getStaticPaths() { │
│ return REPOS.filter(repoAvailable).flatMap((r) => │
│ - branches(r.path).flatMap((branch) => [ │
│ + [defaultBranch(r.path)].flatMap((branch) => [ │
│ { params: { repo: r.slug, rest: branch }, props: { repo: r, branch, dir: "" │
│ } }, │
│ - ...repoDirs(repoFiles(r.path, branch)).map((dir) => ({ │
│ + ...repoDirs(repoFiles(r.path, branch)).filter((d) => !excluded(r, d)).map(( │
│ dir) => ({ │
│ params: { repo: r.slug, rest: `${branch}/${dir}` }, │
│ props: { repo: r, branch, dir }, │
│ })), │
│ @@ -55,7 +55,8 @@ const section = (w: number) => [row2(`FILES @ ${branch}`, "", w) │
│ , ruleD(w)].join │
│ <GitListing entries={entries} │
│ treeBase={`/git/${repo.slug}/tree/${branch}/`} │
│ blobBase={`/git/${repo.slug}/blob/${branch}/`} │
│ - commitBase={`/git/${repo.slug}/commit/`} /> │
│ + commitBase={`/git/${repo.slug}/commit/`} │
│ + isLinked={(e) => !excluded(repo, e.path)} /> │
│ <Pre>{" "}</Pre> │
│ <ArticleFooter /> │
│ </ArticleLayout> │
└────────────────────────────────────────────────────────────────────────────────────┘
┌─ ...t/[repo]/tree/[...rest].astro ───┐
│ diff --git a/ooknet-design/src/pages/git/[re │
│ po]/tree/[...rest].astro b/ooknet-design/src │
│ /pages/git/[repo]/tree/[...rest].astro │
│ index 64f5007..1495885 100644 │
│ --- a/ooknet-design/src/pages/git/[repo]/tre │
│ e/[...rest].astro │
│ +++ b/ooknet-design/src/pages/git/[repo]/tre │
│ e/[...rest].astro │
│ @@ -14,13 +14,13 @@ import Button from "../. │
│ ./../../components/Button/Button.astro"; │
│ import ArticleFooter from "../../../../comp │
│ onents/ArticleFooter/ArticleFooter.astro"; │
│ import { row2, ruleD } from "../../../../li │
│ b/ascii"; │
│ import { REPOS } from "../../../../git.conf │
│ ig"; │
│ -import { repoAvailable, branches, defaultBr │
│ anch, repoFiles, repoDirs, dirEntries, type │
│ GitRepo } from "../../../../lib/git"; │
│ +import { repoAvailable, defaultBranch, excl │
│ uded, repoFiles, repoDirs, dirEntries, type │
│ GitRepo } from "../../../../lib/git"; │
│ │
│ export function getStaticPaths() { │
│ return REPOS.filter(repoAvailable).flatMa │
│ p((r) => │
│ - branches(r.path).flatMap((branch) => [ │
│ + [defaultBranch(r.path)].flatMap((branch │
│ ) => [ │
│ { params: { repo: r.slug, rest: branc │
│ h }, props: { repo: r, branch, dir: "" } }, │
│ - ...repoDirs(repoFiles(r.path, branch) │
│ ).map((dir) => ({ │
│ + ...repoDirs(repoFiles(r.path, branch) │
│ ).filter((d) => !excluded(r, d)).map((dir) = │
│ > ({ │
│ params: { repo: r.slug, rest: `${br │
│ anch}/${dir}` }, │
│ props: { repo: r, branch, dir }, │
│ })), │
│ @@ -55,7 +55,8 @@ const section = (w: number │
│ ) => [row2(`FILES @ ${branch}`, "", w), rule │
│ D(w)].join │
│ <GitListing entries={entries} │
│ treeBase={`/git/${repo.slug}/tree/${bra │
│ nch}/`} │
│ blobBase={`/git/${repo.slug}/blob/${bra │
│ nch}/`} │
│ - commitBase={`/git/${repo.slug}/commit/` │
│ } /> │
│ + commitBase={`/git/${repo.slug}/commit/` │
│ } │
│ + isLinked={(e) => !excluded(repo, e.path │
│ )} /> │
│ <Pre>{" "}</Pre> │
│ <ArticleFooter /> │
│ </ArticleLayout> │
└──────────────────────────────────────────────┘
[ BACK TO LOG ]
──────────────────────────────────────────────────────────────────────────────────────
OOKNET
────────────────────────────────────────────────
OOKNET