client

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

pkg/client/generator.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(manifest ContentManifest, config Config) (string, error)

Generate creates the client-side JavaScript code

Types

type Config

type Config struct {
	DefaultRoute       string // Route to load on initial visit (default: first page)
	EnableTransitions  bool   // Enable fade transitions between pages
	TransitionDuration int    // Transition duration in milliseconds (default: 150)
	NavSelector        string // CSS selector for nav container (default: "#nav")
	ContentSelector    string // CSS selector for content container (default: "#content")
	SiteTitle          string
}

Config controls client-side behavior

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns sensible defaults

type ContentManifest

type ContentManifest struct {
	Pages map[string]Page `json:"pages"`
}

ContentManifest represents the structure of content.json

type Page

type Page struct {
	Route    string                 `json:"route"`
	Content  string                 `json:"content"`
	Metadata map[string]interface{} `json:"metadata"`
}

Jump to

Keyboard shortcuts

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