siteinfo

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package siteinfo is the shared catalog of HB Labs site constants that are neither translatable copy (those live in each service's locales/*.json) nor derived from routing (those come from pageURL / canonical). Think: footer social links and the legal entity name — values that would otherwise be hardcoded in templates and grep-and-replaced on every change.

It is shared because more than one service surfaces the same footer: every HB Labs site links the same socials and shows the same company name. The wiring mirrors web/uikit exactly — services merge siteinfo.FuncMap() into their site.Options.FuncMap, so a developer who knows the uikit pattern knows this one.

Structural data in siteinfo.yaml (go:embedded at build time), strict YAML (KnownFields(true)), errors at boot not at render. The YAML lives inside this package dir because //go:embed cannot reference parent directories — a literal repo-root file could not be baked into the self-contained service binaries.

Editing flow:

  • Change a value / add a social link → edit siteinfo.yaml.
  • Verify → go test ./web/siteinfo/
  • Templates call {{ legalEntity }} and {{ range socialLinks }}.

Index

Constants

This section is empty.

Variables

View Source
var Info = mustLoad()

Info is populated from siteinfo.yaml at package init. Source of truth for the footer's social links + legal entity across every HB Labs service.

Functions

func FuncMap

func FuncMap() template.FuncMap

FuncMap exposes the helpers every service merges into its site.Options.FuncMap, exactly like uikit.FuncMap(). Centralising the helper names here means a future addition lands once and propagates on next deploy, without per-service wiring drift.

Helper signatures:

{{ legalEntity }}        → string, footer copyright line
{{ legalAddress }}       → string, registered address (legal pages)
{{ contactEmail }}       → string, public contact (mailto:)
{{ privacyEmail }}       → string, GDPR / RGPD contact (mailto:)
{{ range socialLinks }}  → []SocialLink, footer social column

socialLinks returns a fresh copy so a template (or a buggy helper downstream) can't mutate the shared Info.Social backing array.

Types

type SiteInfo

type SiteInfo struct {
	// LegalEntity is the company name in the footer copyright line
	// (e.g. "HB Labs SAS"). One edit renames it everywhere.
	LegalEntity string `yaml:"legal_entity"`

	// LegalAddress is the registered address of the legal entity,
	// surfaced on legal pages (privacy, imprint) via {{ legalAddress }}.
	LegalAddress string `yaml:"legal_address"`

	// ContactEmail is the public address surfaced in mailto: links
	// (plans-page CTAs, "write to us"). One edit, every service.
	ContactEmail string `yaml:"contact_email"`

	// PrivacyEmail is the dedicated mailbox for data-protection
	// requests (GDPR / RGPD), surfaced on the privacy page via
	// {{ privacyEmail }}. Kept distinct from ContactEmail so DPO
	// traffic doesn't drown in general inquiries.
	PrivacyEmail string `yaml:"privacy_email"`

	// Social is the footer social column, in declared (render) order.
	Social []SocialLink `yaml:"social"`
}

SiteInfo is the whole siteinfo.yaml document: the constants the footer needs that are neither locale copy nor routed URLs.

type SocialLink struct {
	// Label is the visible link text. Not translated — account /
	// brand names are language-neutral.
	Label string `yaml:"label"`

	// URL is the destination. The layout renders it with
	// target="_blank" rel="noopener".
	URL string `yaml:"url"`
}

SocialLink is one entry in a service footer's "Social" column.

Jump to

Keyboard shortcuts

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