Documentation
¶
Index ¶
- func DerivePagesBasePath(repositoryName string) string
- func FindProjectRoot(start string) (string, error)
- func FindUnresolvedPlaceholders(outputDir string) []string
- func Manifest(cfg SiteConfig) ([]byte, error)
- func Preview(projectRoot string, cfg SiteConfig, address string) error
- func ProductionURL(owner, repositoryName string) string
- func Robots(cfg SiteConfig) string
- func ServiceWorker(cfg SiteConfig, version string, precache []string) string
- func Sitemap(cfg SiteConfig) string
- type APIDocumentation
- type APIItem
- type BuildResult
- type PageConfig
- type PageMetadata
- type PrimaryPalette
- type SiteConfig
- type ThemeConfig
- type ThemePalette
- type ValidationResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DerivePagesBasePath ¶
DerivePagesBasePath derives a GitHub project Pages path from a repository name.
func FindProjectRoot ¶
FindProjectRoot searches upward for the module definition.
func FindUnresolvedPlaceholders ¶
FindUnresolvedPlaceholders finds template markers and stale identities in generated text files.
func Manifest ¶
func Manifest(cfg SiteConfig) ([]byte, error)
Manifest renders the installable website manifest from central identity.
func Preview ¶
func Preview(projectRoot string, cfg SiteConfig, address string) error
Preview builds, validates, and serves the production-like artifact below its Pages base path.
func ProductionURL ¶
ProductionURL derives the canonical GitHub Pages URL for a project repository.
func Robots ¶
func Robots(cfg SiteConfig) string
Robots renders the crawler policy for the production site.
func ServiceWorker ¶
func ServiceWorker(cfg SiteConfig, version string, precache []string) string
ServiceWorker generates a project-scoped worker with network-first HTML and cache-first assets.
func Sitemap ¶
func Sitemap(cfg SiteConfig) string
Sitemap renders exactly the configured public page URLs.
Types ¶
type APIDocumentation ¶
APIDocumentation is the exported API extracted from the root Go package.
func ExtractAPI ¶
func ExtractAPI(projectRoot, importPath string) (APIDocumentation, error)
ExtractAPI parses the root package and returns documentation for exported declarations only.
type BuildResult ¶
BuildResult describes a completed deterministic Pages build.
func Build ¶
func Build(projectRoot string, cfg SiteConfig) (BuildResult, error)
Build creates the complete GitHub Pages artifact from source templates and the public Go API.
type PageConfig ¶
type PageConfig struct {
Name string
OutputPath string
Path string
Title string
Description string
SchemaType string
}
PageConfig owns the unique identity and production location of one public page.
type PageMetadata ¶
type PageMetadata struct {
Title string
Description string
Canonical string
OGType string
SiteName string
OGImage string
OGImageAlt string
JSONLD template.JS
}
PageMetadata contains the generated SEO and structured-data identity for a page.
func Metadata ¶
func Metadata(cfg SiteConfig, page PageConfig) (PageMetadata, error)
Metadata creates page-specific metadata from the central configuration.
type PrimaryPalette ¶
type PrimaryPalette struct {
Base string `json:"base"`
Hover string `json:"hover"`
Active string `json:"active"`
Soft string `json:"soft"`
RGB string `json:"rgb"`
HoverRGB string `json:"hoverRgb"`
}
PrimaryPalette defines interactive and soft-accent colors for one mode.
type SiteConfig ¶
type SiteConfig struct {
PackageName string
DisplayName string
ModulePath string
Description string
RepositoryOwner string
RepositoryName string
RepositoryURL string
PagesBasePath string
PagesURL string
Theme ThemeConfig
CachePrefix string
PWAShortName string
GoVersion string
License string
OutputDir string
SiteSourceDir string
Favicon string
Icon192 string
Icon512 string
MaskableIcon512 string
AppleTouchIcon string
OpenGraphImage string
Pages []PageConfig
}
SiteConfig is the build-time source of truth for project, website, SEO, theme, and PWA identity. It belongs to internal tooling and is not part of the public package API.
func LoadConfig ¶
func LoadConfig(projectRoot string) (SiteConfig, error)
LoadConfig reads the editable site.config.json file and derives deployment-specific values.
func (SiteConfig) AssetURL ¶
func (c SiteConfig) AssetURL(assetPath string) string
AssetURL returns a repository-subpath-aware URL for a generated asset.
func (SiteConfig) CanonicalURL ¶
func (c SiteConfig) CanonicalURL(page PageConfig) string
CanonicalURL returns the absolute production URL for page.
func (SiteConfig) Page ¶
func (c SiteConfig) Page(name string) (PageConfig, bool)
Page finds a configured page by name.
func (SiteConfig) Validate ¶
func (c SiteConfig) Validate() error
Validate checks invariants needed by generation and deployment.
type ThemeConfig ¶
type ThemeConfig struct {
StorageKey string `json:"-"`
ColorLight string `json:"colorLight"`
ColorDark string `json:"colorDark"`
Primary ThemePalette `json:"primary"`
}
ThemeConfig owns the website color modes and persisted preference identity.
type ThemePalette ¶
type ThemePalette struct {
Light PrimaryPalette `json:"light"`
Dark PrimaryPalette `json:"dark"`
}
ThemePalette contains the coordinated primary colors for both Bootstrap modes.
type ValidationResult ¶
ValidationResult summarizes final-artifact checks.
func ValidateArtifact ¶
func ValidateArtifact(projectRoot string, cfg SiteConfig) (ValidationResult, error)
ValidateArtifact validates the generated Pages artifact rather than source templates.