package gallery // Every gallery page is the sidebar shell Fiesta ships: the gallery // documents the shell by being one. pageTemplate is Rastrillo's page // template over Fiesta's seams: say in place of P and T, the scheme // menu lifted from the scheme-menu example in place of the three // buttons, the page's Icon and Asset methods, every link the gallery // owns marked data-gallery-nav, and the scheme store attribute on // so fiesta.js remembers the choice. // // The head loads tokens.css, the theme, shell.css and gallery.css, then // gallery.js blocking, so a stored scheme is on the root and the // frame-hiding rule is armed before the first paint; fiesta.js and // anchor.js deferred, as the scheme-menu example loads them; shell.js // deferred and render-blocking, as the layouts load it, so the slide's // direction is set at the first render. // // The Overview's phone heading leaves the shell's brand span empty and // puts the gallery's name in the title span after it. The shell hides // a brand span with no element in it, as a blank brand, and shows the // title instead; a brand link would add a tab stop that goes to the // page it is on. The ds-prefs menu is written once per page, in the // index's header row or in a content page's back strip, and both it // and the bar draw their controls from one value, so the two cannot // differ. // // The live region at the foot carries the Copy button's three words // and the join as data attributes, so the script writes no words of // its own. const pageTemplate = `{{define "ds-controls"}} {{.Scheme}}
{{say "gallery.language"}}{{say "gallery.language.current" "language" .LocaleName}}
{{range .Locales}}{{.Name}}{{end}}
{{end}} {{define "ds-prefs"}}
` + cogIcon + `
{{template "ds-controls" .}}
{{end}} {{define "ds-page"}} {{.Title}} {{range .Scripts}} {{end}}
{{say "gallery.skip"}} {{with .Up}}
{{say "gallery.up.label"}}{{template "ds-prefs" $.Bar}}
{{end}}
{{say "gallery.brand"}}
{{template "ds-controls" .Bar}}
{{.Name}}
{{.Body}}

{{end}}` // cogIcon is the display settings button's glyph, Lucide's settings // (ISC, as the icon set), drawn the way the set draws its own. Fiesta's // icons/ has no settings glyph and is frozen, and this one button is // the gallery's furniture, not something an app is offered, so it is // drawn here rather than given a slug. aria-hidden: the button's name // is its aria-label. const cogIcon = `` func init() { registerTemplate(pageTemplate) }