Documentation
¶
Index ¶
- Constants
- type Brand
- type Card
- type Contact
- type Link
- type Page
- func (p *Page) AddSubPage(subpage SubPage) *Page
- func (p *Page) Render() *dom.Element
- func (p *Page) RenderCSS() *css.Stylesheet
- func (p *Page) RenderPages() []html.Page
- func (p *Page) RenderSheet() *style.Sheet
- func (p *Page) String() string
- func (p *Page) WidgetKind() widget.Kind
- func (p *Page) WidgetName() widget.Name
- func (p *Page) WithSEO(doc html.DocumentOptions) *Page
- func (p *Page) WithSubPages(subpages ...SubPage) *Page
- type Schedule
- type Section
- func Cards(title string, cards ...Card) *Section
- func Footer(menu ...Link) *Section
- func Form(title string, intro string, formComp dom.Component) *Section
- func Header(menu ...Link) *Section
- func Hero(title, subtitle string, ctas []Link, slides ...Slide) *Section
- func Hours(title string, contact Contact, schedules ...Schedule) *Section
- func InfoBar(contact Contact) *Section
- func MapEmbed(title string, mapURL string) *Section
- func Split(title string, imageSrc string, paragraphs ...string) *Section
- func Stats(stats ...Stat) *Section
- type Slide
- type Stat
- type SubPage
Constants ¶
const ( // SizesSplit: Split tiene dos hijos y auto-fit colapsa las pistas // vacias, asi que nunca pasa de dos columnas. El quiebre sale de // --column-medium (20rem = 320px) + gap (1rem = 16px) + el padding de // la seccion (1.5rem = 24px por lado): dos pistas entran a partir de 704px. // Nota: este valor se deriva de los tokens de tinywasm/css (--column-medium, // --space-4, --space-6). Si esos tokens cambian en css.go, este valor debe actualizarse. SizesSplit = "(max-width: 703px) 100vw, 50vw" // SizesCard: la grilla es intrinseca (auto-fit + minmax), no tiene // media queries. Suma una columna cada vez que entra otra pista de // 320px mas su gap de 16px (y 48px de padding de seccion): 704, 1040 y 1376px. // Nota: este valor se deriva de los tokens de tinywasm/css (--column-medium, // --space-4, --space-6). Si esos tokens cambian en css.go, este valor debe actualizarse. SizesCard = "(max-width: 703px) 100vw, (max-width: 1039px) 50vw, (max-width: 1375px) 33vw, 25vw" )
const NameLanding = widget.Name("landing")
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Brand ¶
type Brand struct {
Name string
WideLogoSrc string
CompactLogoSrc string
LogoAlt string
Href string
}
Brand defines the site identity parameters for headers and footers.
type Card ¶
type Card struct {
Title string
Description string
Image string
Href string
Badge string
// LinkLabel is what the footer link reads. It defaults to Title, which
// is the shape a card catalogue usually wants — but a card whose heading
// is already the first thing in the box then repeats itself two lines
// later ("Medicina General … Medicina General"), which reads as a
// templating slip rather than as a call to action.
LinkLabel string
}
Card defines a content item used in card grid sections.
type Page ¶
type Page struct {
dom.Element
Brand Brand
Sections []*Section
Doc html.DocumentOptions
SubPages []SubPage
}
Page is the landing layout root structure.
func (*Page) AddSubPage ¶
AddSubPage adds a single detail subpage.
func (*Page) RenderCSS ¶
func (p *Page) RenderCSS() *css.Stylesheet
RenderCSS implements visual contract for landing layout.
func (*Page) RenderPages ¶
RenderPages implements html.PagesProvider for multi-page static site emission.
sitec's extraction probes a producer by instantiating a zero-value &Page{} to discover the method; without this guard that probe would itself emit a homepage at "/", colliding with the real page's route.
func (*Page) RenderSheet ¶
RenderSheet returns the style Sheet containing the rules for landing.
func (*Page) WidgetKind ¶
WidgetKind implements widget.Widget.
func (*Page) WidgetName ¶
WidgetName implements widget.Widget.
func (*Page) WithSEO ¶
func (p *Page) WithSEO(doc html.DocumentOptions) *Page
WithSEO configures the root page head metadata.
func (*Page) WithSubPages ¶
WithSubPages attaches additional pages for multi-page site output.
type Section ¶
type Section struct {
// contains filtered or unexported fields
}
Section is an explicit page section with optional navigation anchor ID. It is built by the section functions (Hero, Split, Cards, …); the only thing a consumer does with one is chain .At(id).
A section holds a builder, not an element: header and footer sections are rendered once per page of a multi-page site, and a dom element has exactly one parent — sharing it across pages panics.
func Footer ¶
Footer creates a site footer section with navigation menu links. The brand line is added by the page, which is the only place that knows the Brand.
func Form ¶
Form creates a form section embedding intro text and form component. The form itself is a single element the consumer built, so this section belongs to one page — a form placed on two pages is the same element with two parents.
func Hero ¶
Hero wraps herobanner.HeroBanner into a hero section. ctas is a slice, not a variadic tail, because slides already occupies that position — and a hero carries more than one call to action often enough to be the normal case, not an exception: "see what we offer" next to "join us" is the shape of nearly every landing page. Pass nil for a hero with no buttons.
type Slide ¶
type Slide struct {
Image string
}
Slide represents a hero gallery slide. It carries only the image because that is all herobanner renders today: a caption field here would be accepted and silently dropped. Captions are added when herobanner grows them upstream.