package templates import ( "strconv" "gitea.lab.audasmedia.com.au/sam/ai-resume/internal/stage" ) // Layout is the whole document. It renders the stage binding it is handed and // never inspects which driver produced it. templ Layout(v LayoutView) { { v.Title } if v.Stage.Mode == stage.ModeStream { } @Nav(v.Nav, v.Area)
@Breadcrumbs(v.Crumbs) { children... }
@Stage(StageView{Binding: v.Stage})
@Footer(v) } // Nav is the six-area navigation: a sidebar on desktop, a
disclosure // below 900 px so it still works with JavaScript disabled. templ Nav(items []NavItem, current string) {
SR Sam Rolfe AI · Platform · Edge @SearchForm("", "nav-search")
} templ navLinks(items []NavItem, current string) { for _, it := range items { { it.Title } } } templ evidenceLink(current string) { Evidence index } // Breadcrumbs shows where the reader is, and is a real link trail. templ Breadcrumbs(crumbs []Crumb) { if len(crumbs) > 0 { } } // SearchForm is a GET form: it works with JavaScript disabled and is upgraded by // HTMX when scripts are available. templ SearchForm(q string, class string) { } // Stage is the presentation panel. Everything about how it is fed comes from // the binding: route mode swaps in pre-rendered fragments, stream mode listens // on an event stream. The markup is identical either way. templ Stage(v StageView) { } // FragmentView renders one stage fragment. This is the only place that knows // what a fragment kind looks like, and it is shared by the route driver (at // build time) and the stream driver (at request time). templ FragmentView(f stage.Fragment) {

{ f.Kind }

{ f.Title }

if f.Subtitle != "" {

{ f.Subtitle }

}
switch f.Kind { case stage.KindText:
@f.Body
case stage.KindCode: if f.Code != nil {
{ f.Code.Label }{ f.Code.Language }
@f.Code.HTML
} case stage.KindDiagram, stage.KindImage:
{ if f.Subtitle != "" {
{ f.Subtitle }
}
case stage.KindVideo:
if f.Subtitle != "" {
{ f.Subtitle }
}
case stage.KindLinks: if len(f.Links) > 0 { } }
if f.Confidence != "" { { f.Confidence } } if f.DocURL != "" { { f.DocTitle } }
} // EvidenceTable lists artefacts. Rows with HXGet load the artefact into the // stage panel; every row is also a plain link, so this works with JavaScript // disabled. templ EvidenceTable(rows []EvidenceRow) { for _, r := range rows { }
Evidence Kind Status
if r.HXGet != "" { { r.Label } } else { { r.Label } } { r.Kind } if r.Confidence != "" { { r.Confidence } }
} // PillarCard is one landing-page pillar: the claim, the numbers, and the way in. templ PillarCard(c PillarCardView) {

if c.Area.Role != "" { { c.Area.Role } }

{ c.Title }

{ c.Claim }

if len(c.Metrics) > 0 { } if len(c.Tech) > 0 { }

if c.Level == 1 { Start here } else { Read the capability page } { strconv.Itoa(c.Pages) } pages { c.Confidence }

} // Timeline renders the history area as a timeline. templ Timeline(items []TimelineItem) {
    for _, it := range items {
  1. { it.Period }

    { it.Title }

    { it.Claim }

    { it.Confidence }
  2. }
} // CodeBlock renders an already-highlighted code exhibit. templ CodeBlock(c stage.Code) {
{ c.Label }{ c.Language }
@c.HTML
} // Footer closes the page with the honesty notes a recruiter needs. templ Footer(v LayoutView) { } func navClass(it NavItem) string { return navClassFor(it.Current) } func navClassFor(current bool) string { if current { return "nav-link nav-current" } return "nav-link" } func currentAttr(it NavItem) string { if it.Current { return "page" } return "" } func driverLabel(m stage.Mode) string { if m == stage.ModeStream { return "stream driver · SSE" } return "route driver · pre-rendered" }