Begin go documentation (ai slop for now)
This commit is contained in:
@@ -72,6 +72,8 @@ func Languages() []Layer {
|
||||
Name: "Go",
|
||||
Href: "/go",
|
||||
Tagline: "The base: config, database, logging, HTTP, mail, validation — and both web engines.",
|
||||
Sub: "the base layer",
|
||||
Live: true,
|
||||
Icon: "server",
|
||||
},
|
||||
{
|
||||
@@ -196,9 +198,12 @@ func layerGrid(rows []Layer) *VNode {
|
||||
return Div(mods...)
|
||||
}
|
||||
|
||||
// No icon beside the name, and none on the "Read the docs" link. The front page reads as a
|
||||
// short list of what kjøl is, and a glyph next to every row — a boat, a table, a globe —
|
||||
// asks to be decoded before the word beside it is read. The words are the point; they carry
|
||||
// themselves. (The reference badge stays: it says something the name does not.)
|
||||
func layerRow(l Layer) *VNode {
|
||||
head := Span(Attr("class", "flex items-center gap-2"),
|
||||
ui.IconInline(l.Icon, 15, iff(l.Live, "text-accent", "text-ink-muted")),
|
||||
Span(Attr("class", "font-medium text-ink"), Text(l.Name)),
|
||||
iff2(l.Live,
|
||||
func() *VNode { return nil },
|
||||
@@ -207,7 +212,7 @@ func layerRow(l Layer) *VNode {
|
||||
Text("reference"))
|
||||
}),
|
||||
)
|
||||
body := P(Attr("class", "mt-1 pl-[23px] text-sm leading-relaxed text-ink-muted"), Text(l.Tagline))
|
||||
body := P(Attr("class", "mt-1 text-sm leading-relaxed text-ink-muted"), Text(l.Tagline))
|
||||
|
||||
if !l.Live {
|
||||
return Div(Attr("class", "px-5 py-4 opacity-75"), head, body)
|
||||
@@ -215,22 +220,13 @@ func layerRow(l Layer) *VNode {
|
||||
// A real navigation: the next layer is a different binary.
|
||||
return A(Attr("class", "block px-5 py-4 no-underline hover:bg-surface-muted"), Attr("href", l.Href),
|
||||
head, body,
|
||||
Span(Attr("class", "mt-2 inline-flex items-center gap-1.5 pl-[23px] text-sm text-accent"),
|
||||
Text("Read the docs"),
|
||||
ui.IconInline("arrow-right", 12, ""),
|
||||
),
|
||||
Span(Attr("class", "mt-2 inline-block text-sm font-medium text-accent"),
|
||||
Text("Read the docs")),
|
||||
)
|
||||
}
|
||||
|
||||
// iff picks a string; iff2 picks a node. Go has no ternary, and a four-line if
|
||||
// statement inside a tree literal breaks the shape of the markup worse than these do.
|
||||
func iff(cond bool, a, b string) string {
|
||||
if cond {
|
||||
return a
|
||||
}
|
||||
return b
|
||||
}
|
||||
|
||||
// iff2 picks a node. Go has no ternary, and a four-line if statement inside a tree literal
|
||||
// breaks the shape of the markup worse than this does.
|
||||
func iff2(cond bool, a, b func() *VNode) *VNode {
|
||||
if cond {
|
||||
return a()
|
||||
@@ -238,18 +234,20 @@ func iff2(cond bool, a, b func() *VNode) *VNode {
|
||||
return b()
|
||||
}
|
||||
|
||||
// No icon on the menu rows either — the name and its one-line tagline are the whole item,
|
||||
// same as the front-page list and the sidebar. (The chevron on the menu TRIGGER stays: it
|
||||
// is not a layer's glyph, it is the cue that the thing opens.)
|
||||
func layerItem(d Deps, l Layer) *VNode {
|
||||
active := CurrentLayer(d.Path()) != nil && CurrentLayer(d.Path()).Href == l.Href
|
||||
|
||||
if !l.Live {
|
||||
return Div(Attr("class", "flex cursor-default flex-col gap-0.5 px-3 py-2 opacity-55"),
|
||||
Span(Attr("class", "flex items-center gap-2 text-sm font-medium text-ink-muted"),
|
||||
ui.IconInline(l.Icon, 14, "text-ink-faint"),
|
||||
Text(l.Name),
|
||||
Span(Attr("class", "rounded-full bg-surface-raised px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-ink-muted"),
|
||||
Text("reference")),
|
||||
),
|
||||
Span(Attr("class", "pl-6 text-xs text-ink-muted"), Text(l.Tagline)),
|
||||
Span(Attr("class", "text-xs text-ink-muted"), Text(l.Tagline)),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -258,10 +256,7 @@ func layerItem(d Deps, l Layer) *VNode {
|
||||
cls += " bg-primary-subtle"
|
||||
}
|
||||
return A(Attr("class", cls), Attr("href", l.Href),
|
||||
Span(Attr("class", "flex items-center gap-2 text-sm font-medium text-ink"),
|
||||
ui.IconInline(l.Icon, 14, "text-accent"),
|
||||
Text(l.Name),
|
||||
),
|
||||
Span(Attr("class", "pl-6 text-xs text-ink-muted"), Text(l.Tagline)),
|
||||
Span(Attr("class", "text-sm font-medium text-ink"), Text(l.Name)),
|
||||
Span(Attr("class", "text-xs text-ink-muted"), Text(l.Tagline)),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user