xonecas.io
8356
Wx

www-xonecas-io / commit b1a5f41

project pages: README with repo-relative links and images, root tree, sources and clone (1007)

Co-Authored-By: Claude Opus 5.5

Sean Caetano Martin2026-11-08 b1a5f413b8877d6713968a66f1fff2c8d2fc1148 parent 9e98dfe

20 files changed

go.mod+2−0
@@ -1,3 +1,5 @@
11 module xonecas.io/site
22
33 go 1.27.3
4+
5+require github.com/yuin/goldmark v1.8.7
go.sum+2−0
@@ -0,0 +1,2 @@
1+github.com/yuin/goldmark v1.8.7 h1:XT/tNqCIbabh0ln675w4x3dv04kQBKi8NwYqi9IJaxI=
2+github.com/yuin/goldmark v1.8.7/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg=
internal/repo/repo.go+5−0
@@ -11,3 +11,8 @@ func Git(dir string, args ...string) (string, error) {
1111 out, err := exec.Command("git", append([]string{"--git-dir", dir}, args...)...).Output()
1212 return strings.TrimSpace(string(out)), err
1313 }
14+
15+// Blob is the exact bytes of a file at a revision, as "HEAD:path".
16+func Blob(dir, rev string) ([]byte, error) {
17+ return exec.Command("git", "--git-dir", dir, "cat-file", "blob", rev).Output()
18+}
internal/site/assets/site.css+25−0
@@ -1,4 +1,5 @@
11 @import "tailwindcss";
2+@plugin "@tailwindcss/typography";
23 @source "../templates";
34 @source inline("bg-{fe,be,both,none,h0,h1,h2,h3,h4,h5,h6,paper,card,ink,soft,line,empty,accent,det,pre,add,del} text-{t0,t1,t2,t3,t4,t5,t6}");
45
@@ -52,3 +53,27 @@
5253 [data-theme=dark] { color-scheme: dark; }
5354 body { -webkit-text-size-adjust: 100%; }
5455 }
56+
57+/* READMEs: the typography plugin in the site's colours, so both themes follow. */
58+.prose {
59+ --tw-prose-body: var(--color-ink);
60+ --tw-prose-headings: var(--color-ink);
61+ --tw-prose-lead: var(--color-soft);
62+ --tw-prose-links: var(--color-accent);
63+ --tw-prose-bold: var(--color-ink);
64+ --tw-prose-counters: var(--color-soft);
65+ --tw-prose-bullets: var(--color-soft);
66+ --tw-prose-hr: var(--color-line);
67+ --tw-prose-quotes: var(--color-soft);
68+ --tw-prose-quote-borders: var(--color-line);
69+ --tw-prose-captions: var(--color-soft);
70+ --tw-prose-code: var(--color-accent);
71+ --tw-prose-pre-code: var(--color-pre-fg);
72+ --tw-prose-pre-bg: var(--color-pre);
73+ --tw-prose-th-borders: var(--color-ink);
74+ --tw-prose-td-borders: var(--color-line);
75+ font-size: 15.5px;
76+}
77+.prose :where(pre) { border-radius: 2px; font-size: 12.5px; }
78+.prose :where(img) { display: inline; margin: 0; }
79+.prose :where(code)::before, .prose :where(code)::after, .prose :where(blockquote p)::before, .prose :where(blockquote p)::after { content: none; }
internal/site/build.go+9−1
@@ -4,6 +4,7 @@ package site
44 import (
55 "embed"
66 "errors"
7+ "fmt"
78 "html/template"
89 "io/fs"
910 "os"
@@ -24,6 +25,7 @@ var static embed.FS
2425 var funcs = template.FuncMap{
2526 "list": func(v ...any) []any { return v },
2627 "lower": strings.ToLower,
28+ "web": func(url string) string { return strings.TrimSuffix(strings.TrimPrefix(url, "https://"), ".git") },
2729 "dict": func(kv ...any) (map[string]any, error) {
2830 if len(kv)%2 != 0 {
2931 return nil, errors.New("dict needs key, value pairs")
@@ -41,12 +43,18 @@ var pages = template.Must(template.New("").Funcs(funcs).ParseFS(templates, "temp
4143 // Build writes the site for the shown projects into out. With a tailwind binary it also compiles site.css.
4244 func Build(projects []project.Project, out, tailwind string) error {
4345 shown := slices.DeleteFunc(slices.Clone(projects), func(p project.Project) bool { return p.Hidden != "" })
46+ rows := Rows(shown)
47+ for i, p := range shown {
48+ if err := writeProject(out, p, rows[i]); err != nil {
49+ return fmt.Errorf("%s: %w", p.Name, err)
50+ }
51+ }
4452 for path, page := range map[string]struct {
4553 name string
4654 data any
4755 }{
4856 "index.html": {"index.html", shown},
49- "projects/index.html": {"projects.html", projectsData(shown)},
57+ "projects/index.html": {"projects.html", projectsData(rows)},
5058 "style/index.html": {"style.html", styleData()},
5159 } {
5260 if err := render(filepath.Join(out, path), page.name, page.data); err != nil {
internal/site/build_test.go+34−2
@@ -2,6 +2,7 @@ package site
22
33 import (
44 "os"
5+ "os/exec"
56 "path/filepath"
67 "strings"
78 "testing"
@@ -9,9 +10,30 @@ import (
910 "xonecas.io/site/internal/project"
1011 )
1112
13+// gitRepo makes a repo with a README that links a doc and shows an image, and returns its git dir.
14+func gitRepo(t *testing.T) string {
15+ dir := t.TempDir()
16+ files := map[string]string{
17+ "README.md": "#Hello\n\n![logo](./img/logo.png) [docs](docs/) [guide](docs/guide.md#top) [web](https://x.io)\n",
18+ "img/logo.png": "\x89PNG\x00\n",
19+ "docs/guide.md": "guide\n",
20+ }
21+ for f, body := range files {
22+ os.MkdirAll(filepath.Join(dir, filepath.Dir(f)), 0o755)
23+ os.WriteFile(filepath.Join(dir, f), []byte(body), 0o644)
24+ }
25+ for _, args := range [][]string{{"init", "-q"}, {"add", "."}, {"-c", "user.name=xonecas", "-c", "user.email=x@x", "commit", "-qm", "first"}} {
26+ if out, err := exec.Command("git", append([]string{"-C", dir}, args...)...).CombinedOutput(); err != nil {
27+ t.Fatal(string(out))
28+ }
29+ }
30+ return filepath.Join(dir, ".git")
31+}
32+
1233 func TestBuild(t *testing.T) {
34+ src := []project.Source{{URL: "https://github.com/xonecas/hello.git", Dir: gitRepo(t), Branch: "main"}}
1335 projects := []project.Project{
14- {Name: "hello", Info: project.Info{Commits: 3, First: "2026-10-01", Last: "2026-11-01", Description: "says hi", Tags: []string{"pre-AI", "small", "frontend"}}},
36+ {Name: "hello", Sources: src, Info: project.Info{Readme: "README.md", Commits: 3, First: "2026-10-01", Last: "2026-11-01", Description: "says hi", Tags: []string{"pre-AI", "small", "frontend"}}},
1537 {Name: "a-fork", Info: project.Info{Hidden: "fork"}},
1638 }
1739 out := t.TempDir()
@@ -42,7 +64,17 @@ func TestBuild(t *testing.T) {
4264 if strings.Contains(string(page), "a-fork") {
4365 t.Error("projects/index.html lists a hidden project")
4466 }
45- for _, f := range []string{"style/index.html", "logo.svg", "projects.js"} {
67+ page, err = os.ReadFile(filepath.Join(out, "projects/hello/index.html"))
68+ if err != nil {
69+ t.Fatal(err)
70+ }
71+ for _, want := range []string{`<h1 id="hello">Hello</h1>`, `src="/projects/hello/raw/img/logo.png"`, `href="/projects/hello/tree/docs/"`,
72+ `href="/projects/hello/blob/docs/guide.md/#top"`, `href="https://x.io"`, `git clone https://github.com/xonecas/hello.git`} {
73+ if !strings.Contains(string(page), want) {
74+ t.Errorf("projects/hello/index.html is missing %q", want)
75+ }
76+ }
77+ for _, f := range []string{"style/index.html", "logo.svg", "projects.js", "projects/hello/raw/img/logo.png"} {
4678 if _, err := os.Stat(filepath.Join(out, f)); err != nil {
4779 t.Error(err)
4880 }
internal/site/page.go+55−0
@@ -0,0 +1,55 @@
1+package site
2+
3+import (
4+ "html/template"
5+ "os"
6+ "path/filepath"
7+
8+ "xonecas.io/site/internal/project"
9+ "xonecas.io/site/internal/repo"
10+)
11+
12+// ProjectPage is the landing page of one project.
13+type ProjectPage struct {
14+ Row ProjectRow
15+ P project.Project
16+ Head Commit
17+ Entries []TreeEntry
18+ Readme template.HTML
19+}
20+
21+// writeProject writes /projects/<name>/ and the README's images under raw/.
22+func writeProject(out string, p project.Project, row ProjectRow) error {
23+ dir := p.Sources[0].Dir
24+ t, err := ReadTree(dir)
25+ if err != nil {
26+ return err
27+ }
28+ page := ProjectPage{Row: row, P: p}
29+ if page.Head, err = headCommit(dir); err != nil {
30+ return err
31+ }
32+ if page.Entries, err = rootEntries(dir, p.Name, t); err != nil {
33+ return err
34+ }
35+ if p.Readme != "" {
36+ var raws []string
37+ if page.Readme, raws, err = Readme(dir, p.Name, p.Readme, t); err != nil {
38+ return err
39+ }
40+ for _, f := range raws {
41+ b, err := repo.Blob(dir, "HEAD:"+f)
42+ if err != nil {
43+ return err
44+ }
45+ dst := filepath.Join(out, "projects", p.Name, "raw", filepath.FromSlash(f))
46+ if err := os.MkdirAll(filepath.Dir(dst), 0o755); err != nil {
47+ return err
48+ }
49+ if err := os.WriteFile(dst, b, 0o644); err != nil {
50+ return err
51+ }
52+ }
53+ }
54+ return render(filepath.Join(out, "projects", p.Name, "index.html"), "project.html", page)
55+}
internal/site/readme.go+87−0
@@ -0,0 +1,87 @@
1+package site
2+
3+import (
4+ "bytes"
5+ "html"
6+ "html/template"
7+ "path"
8+ "regexp"
9+ "strings"
10+
11+ "github.com/yuin/goldmark"
12+ "github.com/yuin/goldmark/extension"
13+ "github.com/yuin/goldmark/parser"
14+ mdhtml "github.com/yuin/goldmark/renderer/html"
15+
16+ "xonecas.io/site/internal/repo"
17+)
18+
19+// Raw HTML stays: READMEs come from xonecas's own repos, and several centre a logo with <p align>.
20+var md = goldmark.New(
21+ goldmark.WithExtensions(extension.GFM),
22+ goldmark.WithParserOptions(parser.WithAutoHeadingID()),
23+ goldmark.WithRendererOptions(mdhtml.WithUnsafe()),
24+)
25+
26+var (
27+ attr = regexp.MustCompile(`\b(src|href)="([^"]*)"`)
28+ external = regexp.MustCompile(`(?i)^([a-z][a-z0-9+.-]*:|#|/)`)
29+ image = regexp.MustCompile(`(?i)\.(png|jpe?g|gif|svg|webp|avif|ico|bmp)$`)
30+ markdown = regexp.MustCompile(`(?i)\.(md|markdown|mdown|mkd)$`)
31+ heading = regexp.MustCompile(`^(#{1,6})([^#\s])`)
32+ fence = regexp.MustCompile("^\\s*(```|~~~)")
33+)
34+
35+// oldHeadings adds the space early Markdown let READMEs skip, as in "#Title", outside code fences.
36+func oldHeadings(text string) string {
37+ lines, code := strings.Split(text, "\n"), false
38+ for i, l := range lines {
39+ if fence.MatchString(l) {
40+ code = !code
41+ } else if !code {
42+ lines[i] = heading.ReplaceAllString(l, "$1 $2")
43+ }
44+ }
45+ return strings.Join(lines, "\n")
46+}
47+
48+// Readme renders the README of project name: Markdown as HTML, anything else as plain text.
49+// Relative links point at the file pages, and relative images at raw/, which the build fills
50+// with the files it returns.
51+func Readme(dir, name, readme string, t Tree) (template.HTML, []string, error) {
52+ text, err := repo.Git(dir, "show", "HEAD:"+readme)
53+ if err != nil || !markdown.MatchString(readme) {
54+ return template.HTML(`<pre class="whitespace-pre-wrap font-mono text-[12.5px]">` + html.EscapeString(text) + `</pre>`), nil, err
55+ }
56+ var buf bytes.Buffer
57+ if err := md.Convert([]byte(oldHeadings(text)), &buf); err != nil {
58+ return "", nil, err
59+ }
60+ var raws []string
61+ out := attr.ReplaceAllStringFunc(buf.String(), func(m string) string {
62+ sub := attr.FindStringSubmatch(m)
63+ u := html.UnescapeString(sub[2])
64+ if u == "" || external.MatchString(u) {
65+ return m
66+ }
67+ p, frag, _ := strings.Cut(u, "#")
68+ p, _, _ = strings.Cut(p, "?")
69+ p = path.Join(path.Dir(readme), p)
70+ switch {
71+ case t.Files[p] && (sub[1] == "src" || image.MatchString(p)):
72+ raws = append(raws, p)
73+ u = href(name, "raw", p)
74+ case t.Files[p]:
75+ u = href(name, "blob", p)
76+ case t.Dirs[p]:
77+ u = href(name, "tree", p)
78+ default:
79+ return m
80+ }
81+ if frag != "" {
82+ u += "#" + frag
83+ }
84+ return sub[1] + `="` + html.EscapeString(u) + `"`
85+ })
86+ return template.HTML(out), raws, nil
87+}
internal/site/rows.go+2−2
@@ -99,8 +99,8 @@ type TagCount struct {
9999 }
100100
101101 // projectsData is the /projects page: the rows by last commit, and the tag pairs with their counts.
102-func projectsData(shown []project.Project) map[string]any {
103- rows := Rows(shown)
102+func projectsData(rows []ProjectRow) map[string]any {
103+ rows = slices.Clone(rows)
104104 slices.SortStableFunc(rows, func(a, b ProjectRow) int { return strings.Compare(b.Last, a.Last) })
105105 pairs := [][]TagCount{{{"frontend", 0}, {"backend", 0}}, {{"small", 0}, {"big", 0}}, {{"pre-AI", 0}, {"post-AI", 0}}}
106106 for _, r := range rows {
internal/site/style.go+6−6
@@ -23,12 +23,12 @@ func styleData() map[string]any {
2323 "Tree": map[string]any{
2424 "Head": Commit{mc, "a2174ac", "chore: pkg bump", "xonecas", "2026-10-02"},
2525 "Entries": []TreeEntry{
26- {true, "bin", "feat: mini-coder-next 0.8.x initial implementation", "2026-09-22"},
27- {true, "src", "fix: don't separate the diff from the related bash call", "2026-09-29"},
28- {false, ".gitignore", "feat: fix type-stripping error when using from npm", "2026-10-02"},
29- {false, "AGENTS.md", "docs: kitty remote-control section in AGENTS.md", "2026-09-26"},
30- {false, "package.json", "chore: pkg bump", "2026-10-02"},
31- {false, "README.md", "feat: docs and relaxed config", "2026-09-28"},
26+ {true, "bin", "feat: mini-coder-next 0.8.x initial implementation", "2026-09-22", ""},
27+ {true, "src", "fix: don't separate the diff from the related bash call", "2026-09-29", ""},
28+ {false, ".gitignore", "feat: fix type-stripping error when using from npm", "2026-10-02", ""},
29+ {false, "AGENTS.md", "docs: kitty remote-control section in AGENTS.md", "2026-09-26", ""},
30+ {false, "package.json", "chore: pkg bump", "2026-10-02", ""},
31+ {false, "README.md", "feat: docs and relaxed config", "2026-09-28", ""},
3232 },
3333 },
3434 "Code": map[string]any{"Name": "README.md · Usage", "Code": "ffmpeg.call(\n [ ... ], // array of ffmpeg flags\n callback // function to call after ffmpeg is done\n);\n\nffmpeg.call(['-i', 'input.avi', '-vcodec', 'libx264', 'output.mp4'], function (err, stdout) {\n if (err) throw err;\n});"},
internal/site/templates/components.html+1−1
@@ -41,7 +41,7 @@
4141 {{with .Head}}<div class="flex flex-wrap gap-x-3 px-4 py-2 bg-empty text-sm"><b>{{.Author}}</b><span class="min-w-0 flex-1 truncate">{{.Msg}}</span><code class="font-mono text-accent">{{.Hash}}</code><span class="text-soft">{{.Date}}</span></div>{{end}}
4242 {{range .Entries}}<div class="grid grid-cols-[1.25rem_minmax(0,1fr)_auto] @xl:grid-cols-[1.25rem_14rem_minmax(0,1fr)_6rem] gap-x-3 px-4 py-1.5 border-t border-line">
4343 <span class="text-accent">{{if .Dir}}▸{{else}}·{{end}}</span>
44- <span class="truncate {{if .Dir}}font-bold{{end}}">{{.Name}}{{if .Dir}}/{{end}}</span>
44+ <a {{with .Href}}href="{{.}}"{{end}} class="truncate no-underline hover:underline {{if .Dir}}font-bold{{end}}">{{.Name}}{{if .Dir}}/{{end}}</a>
4545 <span class="hidden @xl:block truncate text-soft">{{.Msg}}</span>
4646 <span class="text-right text-sm text-soft">{{.Date}}</span>
4747 </div>{{end}}
internal/site/templates/project.html+45−0
@@ -0,0 +1,45 @@
1+{{define "project.html"}}{{template "head" .P.Name}}{{template "nav" "Projects"}}
2+<main class="px-4 sm:px-8 py-6 max-w-[1440px] mx-auto">
3+ <header class="flex gap-5 items-start mb-6">
4+ <div class="hidden sm:block">{{template "element" (dict "El" .Row.El "Size" "lg")}}</div>
5+ <div class="min-w-0">
6+ <h1 class="text-4xl font-bold break-words">{{.P.Name}}</h1>
7+ <p class="mt-1 text-lg">{{or .P.Description "No description"}}</p>
8+ <div class="flex flex-wrap gap-1 mt-3">{{range .P.Tags}}{{template "tag" .}}{{end}}</div>
9+ <p class="mt-3 text-sm text-soft">
10+ <b class="text-ink">{{.P.Commits}}</b> commits{{if ne .P.Commits .P.Total}} of {{.P.Total}}{{end}} ·
11+ {{.P.First}} to {{.P.Last}} · {{.P.Files}} files{{if .P.Stars}} · {{.P.Stars}} ★{{end}}
12+ </p>
13+ </div>
14+ </header>
15+ <div class="grid grid-cols-1 gap-8 lg:grid-cols-[minmax(0,1fr)_20rem]">
16+ <div class="min-w-0 space-y-6">
17+ {{template "file-tree" (dict "Head" .Head "Entries" .Entries)}}
18+ <article class="border-[1.5px] border-ink rounded-[2px] bg-card">
19+ <h2 class="px-4 py-2 border-b-[1.5px] border-ink font-mono text-sm font-semibold">{{or .P.Readme "README"}}</h2>
20+ {{if .Readme}}<div class="prose max-w-none px-4 sm:px-6 py-4 overflow-x-auto">{{.Readme}}</div>
21+ {{else}}<p class="px-4 py-6 font-serif italic text-soft">No README. The files above are all there is.</p>{{end}}
22+ </article>
23+ </div>
24+ <aside class="space-y-6 text-sm">
25+ <section>
26+ <h2 class="font-bold border-b-[3px] border-ink pb-1 mb-2">Languages</h2>
27+ {{range .P.Languages}}<div class="grid grid-cols-[6rem_1fr_2.5rem] gap-2 items-center py-0.5"><span class="truncate">{{.Name}}</span>
28+ <div class="h-2.5 bg-empty rounded-[2px]"><div class="h-full bg-h3 rounded-[2px]" style="width:{{.Percent}}%"></div></div><span class="text-right text-soft">{{.Percent}}%</span></div>
29+ {{else}}<p class="text-soft">None detected</p>{{end}}
30+ </section>
31+ <section>
32+ <h2 class="font-bold border-b-[3px] border-ink pb-1 mb-2">Sources</h2>
33+ {{range .P.Sources}}<div class="py-1.5 border-b border-line">
34+ <a href="https://{{web .URL}}" class="font-semibold break-all">{{web .URL}}</a>
35+ <div class="text-soft">{{.Branch}} · {{.Commits}} commits{{if .Stars}} · {{.Stars}} ★{{end}}</div>
36+ </div>{{end}}
37+ </section>
38+ <section>
39+ <h2 class="font-bold border-b-[3px] border-ink pb-1 mb-2">Clone</h2>
40+ <pre class="bg-pre text-pre-fg rounded-[2px] px-4 py-3 font-mono text-[12.5px] whitespace-pre-wrap break-all select-all">git clone {{(index .P.Sources 0).URL}}</pre>
41+ </section>
42+ </aside>
43+ </div>
44+</main>
45+{{template "foot"}}{{end}}
internal/site/tree.go+80−0
@@ -0,0 +1,80 @@
1+package site
2+
3+import (
4+ "net/url"
5+ "path"
6+ "slices"
7+ "strings"
8+
9+ "xonecas.io/site/internal/repo"
10+)
11+
12+// Tree is the files and folders on a project's default branch.
13+type Tree struct{ Files, Dirs map[string]bool }
14+
15+// ReadTree lists every path on HEAD of the bare repo dir.
16+func ReadTree(dir string) (Tree, error) {
17+ t := Tree{Files: map[string]bool{}, Dirs: map[string]bool{}}
18+ out, err := repo.Git(dir, "ls-tree", "-r", "-z", "--name-only", "HEAD")
19+ for _, f := range strings.Split(out, "\x00") {
20+ if f == "" {
21+ continue
22+ }
23+ t.Files[f] = true
24+ for d := path.Dir(f); d != "."; d = path.Dir(d) {
25+ t.Dirs[d] = true
26+ }
27+ }
28+ return t, err
29+}
30+
31+// href is where a path of project name lives on the site: kind is tree, blob or raw.
32+func href(name, kind, p string) string {
33+ u := (&url.URL{Path: "/projects/" + name + "/" + kind + "/" + p}).String()
34+ if kind != "raw" {
35+ u += "/"
36+ }
37+ return u
38+}
39+
40+// headCommit is the last commit on HEAD.
41+func headCommit(dir string) (Commit, error) {
42+ out, err := repo.Git(dir, "log", "-1", "--format=%h%x09%an%x09%as%x09%s", "HEAD")
43+ f := strings.SplitN(out, "\t", 4)
44+ if err != nil || len(f) < 4 {
45+ return Commit{}, err
46+ }
47+ return Commit{Hash: f[0], Author: f[1], Date: f[2], Msg: f[3]}, nil
48+}
49+
50+// rootEntries is the top folder of project name, folders first, each with its last commit.
51+func rootEntries(dir, name string, t Tree) ([]TreeEntry, error) {
52+ var entries []TreeEntry
53+ for f := range t.Files {
54+ if !strings.Contains(f, "/") {
55+ entries = append(entries, TreeEntry{Name: f, Href: href(name, "blob", f)})
56+ }
57+ }
58+ for d := range t.Dirs {
59+ if !strings.Contains(d, "/") {
60+ entries = append(entries, TreeEntry{Dir: true, Name: d, Href: href(name, "tree", d)})
61+ }
62+ }
63+ slices.SortFunc(entries, func(a, b TreeEntry) int {
64+ if a.Dir != b.Dir {
65+ if a.Dir {
66+ return -1
67+ }
68+ return 1
69+ }
70+ return strings.Compare(strings.ToLower(a.Name), strings.ToLower(b.Name))
71+ })
72+ for i, e := range entries {
73+ out, err := repo.Git(dir, "log", "-1", "--format=%s%x09%as", "HEAD", "--", ":(literal)"+e.Name)
74+ if err != nil {
75+ return nil, err
76+ }
77+ entries[i].Msg, entries[i].Date, _ = strings.Cut(out, "\t")
78+ }
79+ return entries, nil
80+}
internal/site/view.go+2−2
@@ -22,8 +22,8 @@ type ProjectRow struct {
2222
2323 // TreeEntry is one file or folder in a file tree, with its last commit.
2424 type TreeEntry struct {
25- Dir bool
26- Name, Msg, Date string
25+ Dir bool
26+ Name, Msg, Date, Href string
2727 }
2828
2929 // Commit is one commit in a feed.
tickets/1007-build-the-project-page-readme-file-tree-tags.md+17−3
@@ -2,13 +2,13 @@
22 id: 1007
33 title: "Build the project page: README, file tree, tags and sources"
44 type: feature
5-status: doing
5+status: review
66 priority: p1
77 area: site
88 created: 2026-11-07T19:30:00Z
9-updated: 2026-11-08T01:09:32Z
9+updated: 2026-11-08T01:37:58Z
1010 source: agent
11-moves: 2026-11-07T19:30:00Z inbox todo agent; 2026-11-08T01:09:32Z todo doing drag
11+moves: 2026-11-07T19:30:00Z inbox todo agent; 2026-11-08T01:09:32Z todo doing drag; 2026-11-08T01:37:58Z doing review agent
1212 ---
1313
1414 xonecas.io/projects/<name> is the landing page of one repo: rendered README, root file tree, tags, languages, dates, commit count, source links, and how to clone.
@@ -16,3 +16,17 @@ xonecas.io/projects/<name> is the landing page of one repo: rendered README, roo
1616 Handle the awkward cases: 14 of your projects have no README, and 2011-era markdown may render oddly (not surveyed). README relative links and images must resolve against the repo.
1717
1818 Done when: mini-coder, ffmpeg-node and a no-README project all render correctly locally.
19+
20+## Notes
21+
22+- 2026-11-08 01:37Z (agent): Done: every shown project has a page at /projects/<name>/ (81 pages). Each has the big tile, description, tags, dates, commit count, files and stars, the root file tree with each entry's last commit, the rendered README, languages, sources and a clone command. mini-coder, ffmpeg-node and orc-code (no README) are attached, plus phone and dark shots.
23+
24+ - The build now reads git for these pages, so 'make build' needs repos/ (from 'make import'). A full build takes about 4s.
25+ - Markdown goes through goldmark with GitHub extensions. The 7 READMEs with no extension render as plain text. Raw HTML is kept, because 6 READMEs use it to centre logos (Zoea-Nova, symb, mini-coder and others). That is safe enough because it is your own content on a static site with no cookies, but say if you want it stripped.
26+ - Relative links and images resolve against the repo. Images are copied to /projects/<name>/raw/<path> (9 across all READMEs, none missing). Links to files go to /projects/<name>/blob/<path>/ and links to folders to /projects/<name>/tree/<path>/. The root file tree links the same way. Those blob and tree pages are 1008's, so they 404 until 1008 lands.
27+ - 2011-era Markdown: ffmpeg-node's '#FFMPEG-NODE' needs a space after the #, which old GitHub didn't require. I add it outside code fences. I didn't find other oddities, but I only looked closely at mini-coder, ffmpeg-node, Zoea-Nova, cel-tui and rotator.
28+ - Clone uses the canonical source URL (the one with the most commits), because the site doesn't serve git yet. When it does (1011's hand-off), this is one line to change.
29+ - No README: 'No README. The files above are all there is.' Edit the copy if you like.
30+
31+ CHECKED: go test, using a test repo with an old-style heading, an image, and links to a folder, a file with an anchor and an external URL. Also: no relative src or href left unresolved in any README, every raw/ image exists, and screenshots at desktop, 390px phone and dark. I measured overflow at 390px on cel-tui (tables), rotator and mini-coder: none.
32+ NOT CHECKED: all 67 READMEs by eye, Chrome and Safari.
tickets/attachments/1007/Zoea-Nova, phone, dark.png+0−0
Binary file, not shown.
tickets/attachments/1007/ffmpeg-node, 2011 README.png+0−0
Binary file, not shown.
tickets/attachments/1007/mini-coder, README image from raw.png+0−0
Binary file, not shown.
tickets/attachments/1007/orc-code, no README.png+0−0
Binary file, not shown.
tickets/attachments/1007/phone width, no overflow (cel-tui, rotator plain-text README, mini-coder).png+0−0
Binary file, not shown.