-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgenerate-index.go
More file actions
724 lines (680 loc) · 22 KB
/
generate-index.go
File metadata and controls
724 lines (680 loc) · 22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
package main
import (
"encoding/json"
"fmt"
"html"
"net/url"
"os"
"strings"
"text/template"
"gopkg.in/yaml.v3"
)
type Config struct {
Categories []Category `yaml:"categories"`
}
type Category struct {
Name string `yaml:"name"`
Slug string `yaml:"slug"`
Repos []Repo `yaml:"repos"`
}
type Repo struct {
Name string `yaml:"name"`
Upstream string `yaml:"upstream"`
Desc string `yaml:"description"`
Pill string `yaml:"pill"`
PillClass string `yaml:"pill_class"`
}
const baseURL = "https://repos.supermodeltools.com"
func main() {
data, err := os.ReadFile("repos.yaml")
if err != nil {
fmt.Fprintf(os.Stderr, "Error reading repos.yaml: %v\n", err)
os.Exit(1)
}
var cfg Config
if err := yaml.Unmarshal(data, &cfg); err != nil {
fmt.Fprintf(os.Stderr, "Error parsing repos.yaml: %v\n", err)
os.Exit(1)
}
if err := os.MkdirAll("site", 0755); err != nil {
fmt.Fprintf(os.Stderr, "Error creating site dir: %v\n", err)
os.Exit(1)
}
if err := generateIndex(cfg); err != nil {
fmt.Fprintf(os.Stderr, "Error generating index: %v\n", err)
os.Exit(1)
}
if err := generateSitemap(cfg); err != nil {
fmt.Fprintf(os.Stderr, "Error generating sitemap: %v\n", err)
os.Exit(1)
}
if err := generate404(cfg); err != nil {
fmt.Fprintf(os.Stderr, "Error generating 404: %v\n", err)
os.Exit(1)
}
// Copy CNAME and static root files to site directory
if cname, err := os.ReadFile("CNAME"); err == nil {
os.WriteFile("site/CNAME", cname, 0644)
}
if vf, err := os.ReadFile("google3f45b72e3ef79ea3.html"); err == nil {
os.WriteFile("site/google3f45b72e3ef79ea3.html", vf, 0644)
}
totalRepos := 0
for _, cat := range cfg.Categories {
totalRepos += len(cat.Repos)
}
fmt.Printf("Generated index.html, sitemap.xml, and 404.html (%d repos)\n", totalRepos)
}
func generateSitemap(cfg Config) error {
var b strings.Builder
b.WriteString(`<?xml version="1.0" encoding="UTF-8"?>` + "\n")
b.WriteString(`<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">` + "\n")
for _, cat := range cfg.Categories {
for _, repo := range cat.Repos {
b.WriteString(fmt.Sprintf(" <sitemap>\n <loc>%s/%s/sitemap.xml</loc>\n </sitemap>\n", baseURL, url.PathEscape(repo.Name)))
}
}
b.WriteString("</sitemapindex>\n")
return os.WriteFile("site/sitemap.xml", []byte(b.String()), 0644)
}
func generateIndex(cfg Config) error {
tmpl, err := template.New("index").Funcs(template.FuncMap{
"escape": html.EscapeString,
"pathEscape": url.PathEscape,
"pillClass": func(s string) string {
if s == "" {
return "pill"
}
return "pill " + s
},
"shieldsURL": func(upstream string) string {
if upstream == "" {
return ""
}
return fmt.Sprintf("https://img.shields.io/github/stars/%s?style=flat&logo=github&color=818cf8&labelColor=1a1d27", upstream)
},
"totalRepos": func() int {
total := 0
for _, cat := range cfg.Categories {
total += len(cat.Repos)
}
return total
},
}).Parse(indexTemplate)
if err != nil {
return fmt.Errorf("parsing template: %w", err)
}
f, err := os.Create("site/index.html")
if err != nil {
return fmt.Errorf("creating index.html: %w", err)
}
defer f.Close()
return tmpl.Execute(f, cfg)
}
const indexTemplate = `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Supermodel Tools — Architecture Docs</title>
<meta name="description" content="Architecture documentation for popular open source repositories. Browse code graphs, dependency diagrams, and codebase structure.">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
<style>
:root {
--bg: #0f1117;
--bg-card: #1a1d27;
--bg-hover: #22263a;
--border: #2a2e3e;
--text: #e4e4e7;
--text-muted: #9ca3af;
--accent: #6366f1;
--accent-light: #818cf8;
--green: #22c55e;
--orange: #f59e0b;
--red: #ef4444;
--blue: #3b82f6;
--font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
--mono: 'JetBrains Mono', 'Fira Code', monospace;
--max-w: 1200px;
--radius: 8px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { overflow-x: hidden; }
body {
font-family: var(--font);
background: var(--bg);
color: var(--text);
line-height: 1.6;
-webkit-font-smoothing: antialiased;
overflow-x: hidden;
}
a { color: var(--accent-light); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 2px; border-radius: 2px; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.site-header {
border-bottom: 1px solid var(--border);
padding: 16px 0;
position: sticky;
top: 0;
background: var(--bg);
z-index: 100;
}
.site-header .container {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
}
.site-brand {
font-size: 18px;
font-weight: 700;
color: var(--text);
display: flex;
align-items: center;
gap: 8px;
white-space: nowrap;
flex-shrink: 0;
}
.site-brand:hover { text-decoration: none; color: var(--accent-light); }
.site-brand svg { width: 24px; height: 24px; }
.site-nav { display: flex; gap: 16px; align-items: center; }
.site-nav a { color: var(--text-muted); font-size: 14px; font-weight: 500; white-space: nowrap; }
.site-nav a:hover { color: var(--text); text-decoration: none; }
.hero {
padding: 64px 0 48px;
text-align: center;
}
.hero h1 {
font-size: 36px;
font-weight: 700;
margin-bottom: 12px;
}
.hero p {
color: var(--text-muted);
font-size: 18px;
max-width: 600px;
margin: 0 auto;
}
.hero-stats {
display: flex;
justify-content: center;
gap: 32px;
margin-top: 32px;
}
.hero-stat { text-align: center; }
.hero-stat .num {
font-size: 28px;
font-weight: 700;
color: var(--accent-light);
}
.hero-stat .label {
font-size: 13px;
color: var(--text-muted);
}
.search-box {
max-width: 480px;
margin: 24px auto 0;
position: relative;
}
.search-input {
width: 100%;
padding: 10px 16px 10px 40px;
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius);
color: var(--text);
font-size: 14px;
font-family: inherit;
outline: none;
transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-muted); }
.search-icon {
position: absolute;
left: 12px;
top: 50%;
transform: translateY(-50%);
width: 18px;
height: 18px;
color: var(--text-muted);
pointer-events: none;
}
.section-title {
font-size: 22px;
font-weight: 700;
margin-bottom: 16px;
}
.section { margin-bottom: 48px; }
.card-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
gap: 16px;
}
.card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 24px;
transition: border-color 0.2s;
display: flex;
flex-direction: column;
}
.card:hover {
border-color: var(--accent);
text-decoration: none;
}
.card.hidden { display: none; }
.card-title {
font-size: 16px;
font-weight: 600;
color: var(--text);
margin-bottom: 8px;
display: flex;
align-items: center;
gap: 8px;
}
.card-title svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--accent-light); }
.card-desc {
font-size: 14px;
color: var(--text-muted);
flex: 1;
margin-bottom: 12px;
}
.card-meta {
display: flex;
gap: 8px;
flex-wrap: wrap;
align-items: center;
}
.pill {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 4px 10px;
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: 20px;
font-size: 12px;
color: var(--text-muted);
font-weight: 500;
}
.pill-accent { border-color: var(--accent); color: var(--accent-light); }
.pill-green { border-color: var(--green); color: var(--green); }
.pill-blue { border-color: var(--blue); color: var(--blue); }
.pill-orange { border-color: var(--orange); color: var(--orange); }
.star-badge { height: 20px; vertical-align: middle; }
.site-footer {
border-top: 1px solid var(--border);
padding: 32px 0;
margin-top: 64px;
color: var(--text-muted);
font-size: 13px;
text-align: center;
}
.no-results {
text-align: center;
color: var(--text-muted);
padding: 48px 0;
font-size: 15px;
display: none;
}
@media (max-width: 768px) {
.container { padding: 0 16px; }
.hero { padding: 40px 0 32px; }
.hero h1 { font-size: 24px; }
.hero p { font-size: 15px; }
.hero-stats { flex-wrap: wrap; gap: 12px; }
.card-grid { grid-template-columns: 1fr; }
.card { padding: 18px; }
.section-title { font-size: 18px; }
.site-footer { margin-top: 40px; padding: 24px 0; }
}
</style>
</head>
<body>
<header class="site-header">
<div class="container">
<a href="/" class="site-brand">
<svg viewBox="0 0 90 78" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M90 61.1124C75.9375 73.4694 59.8419 78 44.7554 78C29.669 78 11.8614 72.6122 0 61.1011V16.9458C11.6168 6 29.891 0 44.9887 0C62.77 0 78.8723 6.97959 89.9887 16.9458V61.1124H90ZM88.1881 38.9553C77.7923 22.8824 59.8983 15.7959 44.7554 15.7959C29.6126 15.7959 13.4515 21.9008 1.556 38.9444C12.5382 54.69 26.9 62.5085 44.7554 62.0944C67.6297 61.5639 77.6495 51.9184 88.1881 38.9553ZM44.7554 16.3475C32.4756 16.3475 22.3888 26.6879 22.2554 38.9388C34.3765 38.9162 44.7554 29.1429 44.7554 16.3475C44.7554 29.1429 55.1344 38.9162 67.2554 38.9388C67.1202 26.5216 57.1141 16.3475 44.7554 16.3475ZM44.7554 61.5639C44.7554 48.4898 34.3765 38.9613 22.2554 38.9388C22.3888 51.1897 32.4756 61.5639 44.7554 61.5639C57.0352 61.5639 67.122 51.1897 67.2554 38.9388C55.1344 38.9613 44.7554 48.4898 44.7554 61.5639Z" fill="currentColor"/>
</svg>
Supermodel Tools
</a>
<nav class="site-nav">
<a href="https://supermodeltools.com">Website</a>
<a href="https://github.com/supermodeltools">GitHub</a>
<a href="https://x.com/supermodeltools">X</a>
</nav>
</div>
</header>
<main>
<div class="container">
<div class="hero">
<h1>Architecture Docs</h1>
<p>Browse architecture documentation, dependency graphs, and code structure for popular open source repositories.</p>
<div class="hero-stats">
<div class="hero-stat">
<div class="num">{{totalRepos}}</div>
<div class="label">Repositories</div>
</div>
{{range .Categories}}
<div class="hero-stat">
<div class="num">{{len .Repos}}</div>
<div class="label">{{.Name}}</div>
</div>
{{end}}
</div>
<div class="search-box">
<svg class="search-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>
<input type="text" class="search-input" id="search" placeholder="Search repositories..." autocomplete="off">
</div>
</div>
<div id="no-results" class="no-results">No repositories match your search.</div>
{{range .Categories}}
<div class="section" data-section="{{.Slug}}">
<h2 class="section-title">{{.Name}}</h2>
<div class="card-grid">
{{range .Repos}}
<a href="/{{pathEscape .Name}}/" class="card" data-name="{{escape .Name}}" data-desc="{{escape .Desc}}">
<div class="card-title">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2L2 7l10 5 10-5-10-5z"/><path d="M2 17l10 5 10-5"/><path d="M2 12l10 5 10-5"/></svg>
{{.Name}}
</div>
<div class="card-desc">{{.Desc}}</div>
<div class="card-meta">
<span class="{{pillClass .PillClass}}">{{.Pill}}</span>
{{if .Upstream}}<img class="star-badge" src="{{shieldsURL .Upstream}}" alt="GitHub Stars" loading="lazy">{{end}}
</div>
</a>
{{end}}
</div>
</div>
{{end}}
</div>
</main>
<footer class="site-footer">
<div class="container">
<p>Generated with <a href="https://github.com/supermodeltools/arch-docs">arch-docs</a> by <a href="https://supermodeltools.com">supermodeltools</a></p>
</div>
</footer>
<script>
(function() {
var input = document.getElementById('search');
var cards = document.querySelectorAll('.card');
var sections = document.querySelectorAll('.section');
var noResults = document.getElementById('no-results');
input.addEventListener('input', function() {
var q = this.value.toLowerCase().trim();
var anyVisible = false;
cards.forEach(function(card) {
var name = (card.getAttribute('data-name') || '').toLowerCase();
var desc = (card.getAttribute('data-desc') || '').toLowerCase();
var match = !q || name.indexOf(q) !== -1 || desc.indexOf(q) !== -1;
card.classList.toggle('hidden', !match);
if (match) anyVisible = true;
});
sections.forEach(function(section) {
var visibleCards = section.querySelectorAll('.card:not(.hidden)');
section.style.display = visibleCards.length ? '' : 'none';
});
noResults.style.display = anyVisible ? 'none' : 'block';
});
})();
</script>
</body>
</html>
`
func generate404(cfg Config) error {
var repoNames []string
for _, cat := range cfg.Categories {
for _, repo := range cat.Repos {
repoNames = append(repoNames, repo.Name)
}
}
repoNamesJSON, err := json.Marshal(repoNames)
if err != nil {
return fmt.Errorf("marshaling repo names: %w", err)
}
type data404 struct {
RepoNamesJSON string
}
tmpl, err := template.New("404").Parse(notFoundTemplate)
if err != nil {
return fmt.Errorf("parsing 404 template: %w", err)
}
f, err := os.Create("site/404.html")
if err != nil {
return fmt.Errorf("creating 404.html: %w", err)
}
defer f.Close()
return tmpl.Execute(f, data404{RepoNamesJSON: string(repoNamesJSON)})
}
const notFoundTemplate = `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Supermodel Tools — Not Found</title>
<meta name="description" content="Architecture documentation for popular open source repositories.">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
<style>
:root {
--bg: #0f1117;
--bg-card: #1a1d27;
--border: #2a2e3e;
--text: #e4e4e7;
--text-muted: #9ca3af;
--accent: #6366f1;
--accent-light: #818cf8;
--font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
--mono: 'JetBrains Mono', 'Fira Code', monospace;
--max-w: 1200px;
--radius: 8px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { overflow-x: hidden; }
body {
font-family: var(--font);
background: var(--bg);
color: var(--text);
line-height: 1.6;
-webkit-font-smoothing: antialiased;
min-height: 100vh;
display: flex;
flex-direction: column;
}
a { color: var(--accent-light); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 2px; border-radius: 2px; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.site-header {
border-bottom: 1px solid var(--border);
padding: 16px 0;
background: var(--bg);
}
.site-header .container {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
}
.site-brand {
font-size: 18px;
font-weight: 700;
color: var(--text);
display: flex;
align-items: center;
gap: 8px;
white-space: nowrap;
flex-shrink: 0;
}
.site-brand:hover { text-decoration: none; color: var(--accent-light); }
.site-brand svg { width: 24px; height: 24px; }
.site-nav { display: flex; gap: 16px; align-items: center; }
.site-nav a { color: var(--text-muted); font-size: 14px; font-weight: 500; white-space: nowrap; }
.site-nav a:hover { color: var(--text); text-decoration: none; }
main {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
}
.generate-hero {
text-align: center;
padding: 64px 24px;
max-width: 560px;
margin: 0 auto;
}
.generate-icon {
width: 64px;
height: 64px;
margin: 0 auto 24px;
color: var(--accent-light);
opacity: 0.8;
}
.generate-hero h1 {
font-size: 28px;
font-weight: 700;
margin-bottom: 12px;
}
.repo-slug {
color: var(--accent-light);
font-family: var(--mono);
}
.generate-hero p {
color: var(--text-muted);
font-size: 16px;
margin-bottom: 32px;
line-height: 1.7;
}
.btn-generate {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 12px 28px;
background: var(--accent);
color: #fff;
border-radius: var(--radius);
font-size: 15px;
font-weight: 600;
font-family: var(--font);
text-decoration: none;
transition: background 0.2s, transform 0.1s;
}
.btn-generate:hover {
background: var(--accent-light);
color: #fff;
text-decoration: none;
transform: translateY(-1px);
}
.btn-generate svg { width: 18px; height: 18px; }
.browse-link {
display: block;
margin-top: 20px;
font-size: 14px;
color: var(--text-muted);
}
.site-footer {
border-top: 1px solid var(--border);
padding: 32px 0;
color: var(--text-muted);
font-size: 13px;
text-align: center;
}
#content { display: none; width: 100%; }
@media (max-width: 768px) {
.container { padding: 0 16px; }
.generate-hero { padding: 48px 0; }
.generate-hero h1 { font-size: 22px; }
.generate-hero p { font-size: 15px; }
}
</style>
</head>
<body>
<header class="site-header">
<div class="container">
<a href="/" class="site-brand">
<svg viewBox="0 0 90 78" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M90 61.1124C75.9375 73.4694 59.8419 78 44.7554 78C29.669 78 11.8614 72.6122 0 61.1011V16.9458C11.6168 6 29.891 0 44.9887 0C62.77 0 78.8723 6.97959 89.9887 16.9458V61.1124H90ZM88.1881 38.9553C77.7923 22.8824 59.8983 15.7959 44.7554 15.7959C29.6126 15.7959 13.4515 21.9008 1.556 38.9444C12.5382 54.69 26.9 62.5085 44.7554 62.0944C67.6297 61.5639 77.6495 51.9184 88.1881 38.9553ZM44.7554 16.3475C32.4756 16.3475 22.3888 26.6879 22.2554 38.9388C34.3765 38.9162 44.7554 29.1429 44.7554 16.3475C44.7554 29.1429 55.1344 38.9162 67.2554 38.9388C67.1202 26.5216 57.1141 16.3475 44.7554 16.3475ZM44.7554 61.5639C44.7554 48.4898 34.3765 38.9613 22.2554 38.9388C22.3888 51.1897 32.4756 61.5639 44.7554 61.5639C57.0352 61.5639 67.122 51.1897 67.2554 38.9388C55.1344 38.9613 44.7554 48.4898 44.7554 61.5639Z" fill="currentColor"/>
</svg>
Supermodel Tools
</a>
<nav class="site-nav">
<a href="https://supermodeltools.com">Website</a>
<a href="https://github.com/supermodeltools">GitHub</a>
<a href="https://x.com/supermodeltools">X</a>
</nav>
</div>
</header>
<main>
<div id="content">
<div class="generate-hero">
<svg class="generate-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
<path d="M12 2L2 7l10 5 10-5-10-5z"/>
<path d="M2 17l10 5 10-5"/>
<path d="M2 12l10 5 10-5"/>
</svg>
<h1 id="page-title">No docs yet for <span class="repo-slug" id="repo-name"></span></h1>
<p id="page-desc">Architecture docs for this repository haven't been generated yet.<br>Request them and we'll add it to the index.</p>
<a href="#" id="generate-btn" class="btn-generate" style="display:none" target="_blank" rel="noopener noreferrer">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 5v14M5 12h14"/></svg>
Generate Docs
</a>
<p class="browse-link"><a href="/">Browse existing docs</a></p>
</div>
</div>
</main>
<footer class="site-footer">
<div class="container">
<p>Generated with <a href="https://github.com/supermodeltools/arch-docs">arch-docs</a> by <a href="https://supermodeltools.com">supermodeltools</a></p>
</div>
</footer>
<noscript>
<style>#content { display: block !important; }</style>
</noscript>
<script>
(function() {
var knownRepos = {{.RepoNamesJSON}};
// Extract first path segment from the current URL
var rawPath = window.location.pathname;
var slug = rawPath.replace(/^\/+/, '').split('/')[0] || '';
// If the slug is a known repo, redirect to its docs
if (slug && knownRepos.indexOf(slug) !== -1) {
window.location.replace('/' + slug + '/');
return;
}
// Show the landing page
var content = document.getElementById('content');
if (content) content.style.display = 'block';
var titleEl = document.getElementById('page-title');
var nameEl = document.getElementById('repo-name');
var descEl = document.getElementById('page-desc');
if (slug) {
// Safely set repo name using textContent (XSS-safe — no innerHTML)
if (nameEl) nameEl.textContent = slug;
// Configure the Generate Docs button
var btn = document.getElementById('generate-btn');
if (btn) {
var title = '[Repo Request] ' + slug;
var body = 'Please generate architecture docs for the \u0060' + slug + '\u0060 repository.\n\n@claude';
btn.href = 'https://github.com/supermodeltools/supermodeltools.github.io/issues/new'
+ '?title=' + encodeURIComponent(title)
+ '&body=' + encodeURIComponent(body);
btn.style.display = 'inline-flex';
}
} else {
// No slug — generic not-found message
if (titleEl) titleEl.textContent = 'Page not found';
if (descEl) descEl.textContent = 'The page you\u2019re looking for doesn\u2019t exist.';
}
})();
</script>
</body>
</html>
`