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 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 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.