landing

package
v0.1.26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
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
}

Card defines a content item used in card grid sections.

type Contact

type Contact struct {
	Phone   string
	Email   string
	Address string
	Hours   string
}

Contact holds business contact information.

type Link struct {
	Label  string
	Href   string
	Active bool
}

Link represents a site navigation link entry.

type Page

type Page struct {
	dom.Element
	Brand    Brand
	Sections []*Section
	Doc      html.DocumentOptions
	SubPages []SubPage
}

Page is the landing layout root structure.

func New

func New(brand Brand, sections ...*Section) *Page

New constructs a landing Page root.

func (*Page) AddSubPage

func (p *Page) AddSubPage(subpage SubPage) *Page

AddSubPage adds a single detail subpage.

func (*Page) Render

func (p *Page) Render() *dom.Element

Render compiles the Page DOM structure.

func (*Page) RenderCSS

func (p *Page) RenderCSS() *css.Stylesheet

RenderCSS implements visual contract for landing layout.

func (*Page) RenderPages

func (p *Page) RenderPages() []html.Page

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

func (p *Page) RenderSheet() *style.Sheet

RenderSheet returns the style Sheet containing the rules for landing.

func (*Page) String

func (p *Page) String() string

String serializes the Page to HTML string.

func (*Page) WidgetKind

func (p *Page) WidgetKind() widget.Kind

WidgetKind implements widget.Widget.

func (*Page) WidgetName

func (p *Page) WidgetName() widget.Name

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

func (p *Page) WithSubPages(subpages ...SubPage) *Page

WithSubPages attaches additional pages for multi-page site output.

type Schedule

type Schedule struct {
	Days  string
	Hours string
}

Schedule holds operational time intervals for a range of days.

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 Cards

func Cards(title string, cards ...Card) *Section

Cards wraps contentcard.ContentCard instances in a responsive card grid section.

func Footer(menu ...Link) *Section

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

func Form(title string, intro string, formComp dom.Component) *Section

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 Header(menu ...Link) *Section

Header wraps sitenav.SiteNav component into a header navigation section.

func Hero

func Hero(title, subtitle string, ctas []Link, slides ...Slide) *Section

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.

func Hours

func Hours(title string, contact Contact, schedules ...Schedule) *Section

Hours creates an operational hours and contact section.

func InfoBar

func InfoBar(contact Contact) *Section

InfoBar wraps infobar.InfoBar component into a page section.

func MapEmbed

func MapEmbed(title string, mapURL string) *Section

MapEmbed creates a map iframe embed section.

func Split

func Split(title string, imageSrc string, paragraphs ...string) *Section

Split creates a two-column story/content section with title, image, and paragraphs.

func Stats

func Stats(stats ...Stat) *Section

Stats wraps statgrid.StatGrid component into a metric grid section.

func (*Section) At

func (s *Section) At(id string) *Section

At sets the navigation anchor ID explicitly for this section.

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.

type Stat

type Stat struct {
	Value string
	Label string
}

Stat represents a numerical metric and its descriptive label.

type SubPage

type SubPage struct {
	Path      string
	Doc       html.DocumentOptions
	Sections  []*Section
	Component dom.Component
}

SubPage represents a detail page in a multi-page site.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL