prerender

package
v4.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 5 Imported by: 0

README

GWC | Prerender Library

GoWebComponents (GWC)

High-Level Overview

The prerender library supports ahead-of-time and server-side render preparation utilities for GWC content.

Public APIs

github.com/monstercameron/GoWebComponents/prerender (package prerender)
  • Functions: Export
  • Types: ExportSummary, Route, RouteOutput, Target
  • Variables: none
  • Constants: none

Subfiles And Purpose

  • export.go - Core implementation for export
  • export_additional_test.go - Tests for export_additional behavior
  • export_test.go - Tests for export behavior

File Map

prerender/
|-- export.go
|-- export_additional_test.go
\-- export_test.go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExportSummary

type ExportSummary struct {
	HTMLFiles      []string
	BootstrapFiles []string
}

ExportSummary reports the files emitted by Export.

func Export

func Export(parseOutputDir string, parseRoutes []Route) (ExportSummary, error)

Export renders the provided routes and writes HTML files plus optional bootstrap sidecars.

type Route

type Route struct {
	Path            string
	BootstrapFormat string
	Build           func(Target) (RouteOutput, error)
}

Route configures one prerendered route export.

type RouteOutput

type RouteOutput struct {
	HTML      string
	Bootstrap []byte
}

RouteOutput holds the rendered HTML and optional bootstrap payload for one route.

type Target

type Target struct {
	RoutePath     string
	HTMLFile      string
	BootstrapFile string
	BootstrapURL  string
}

Target describes the computed output locations for one prerendered route.

Jump to

Keyboard shortcuts

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