ops

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SyncAssets

func SyncAssets(cfg *config.Config, hooks AssetHookRunner) error

SyncAssets runs the asset pipeline with Foundry's standard diagnostic wrapping.

func WriteBuildReport

func WriteBuildReport(cfg *config.Config, graph *content.SiteGraph, target string, preview bool, stats renderer.BuildStats) error

WriteBuildReport persists the latest build summary for admin diagnostics and the Debug dashboard.

func WritePreviewManifest

func WritePreviewManifest(cfg *config.Config, graph *content.SiteGraph, target string, enabled bool) error

WritePreviewManifest writes preview-links.json for non-published documents when preview manifest output is enabled.

Types

type AssetHookRunner

type AssetHookRunner interface {
	OnAssetsBuilding(*config.Config) error
}

AssetHookRunner represents asset-build hooks.

type BuildReport

type BuildReport struct {
	GeneratedAt   time.Time           `json:"generated_at"`
	Environment   string              `json:"environment"`
	Target        string              `json:"target,omitempty"`
	Preview       bool                `json:"preview"`
	DocumentCount int                 `json:"document_count"`
	RouteCount    int                 `json:"route_count"`
	Stats         renderer.BuildStats `json:"stats"`
}

BuildReport is the persisted operational summary for the most recent build.

type DiagnosticReport

type DiagnosticReport struct {
	BrokenMediaRefs       []string
	BrokenInternalLinks   []string
	MissingTemplates      []string
	OrphanedMedia         []string
	DuplicateURLs         []string
	DuplicateSlugs        []string
	TaxonomyInconsistency []string
}

DiagnosticReport aggregates site-level validation findings discovered outside the strict config/theme validators.

func AnalyzeSite

func AnalyzeSite(cfg *config.Config, graph *content.SiteGraph) DiagnosticReport

AnalyzeSite inspects the loaded graph and supporting files for operational issues such as broken references, missing templates, and orphaned media.

func (DiagnosticReport) Messages

func (r DiagnosticReport) Messages() []string

Messages flattens all diagnostic categories into a single ordered message slice suitable for CLI output.

type GraphLoader

type GraphLoader interface {
	Load(context.Context) (*content.SiteGraph, error)
}

GraphLoader loads the site graph for operational helpers.

type PreparedGraph

type PreparedGraph struct {
	Graph    *content.SiteGraph
	DepGraph *deps.Graph
}

PreparedGraph combines the loaded site graph with its dependency graph.

func LoadPreparedGraph

func LoadPreparedGraph(ctx context.Context, loader GraphLoader, resolver *router.Resolver, hooks RouteHookRunner, activeTheme string) (*PreparedGraph, error)

LoadPreparedGraph loads the graph, assigns routes, runs route hooks, and builds the dependency graph used by preview rebuilds.

type PreviewLink struct {
	Title      string `json:"title"`
	Status     string `json:"status"`
	Type       string `json:"type"`
	Lang       string `json:"lang"`
	SourcePath string `json:"source_path"`
	URL        string `json:"url"`
	PreviewURL string `json:"preview_url"`
}

PreviewLink identifies a previewable document emitted into preview-links.json.

type PreviewManifest

type PreviewManifest struct {
	GeneratedAt time.Time     `json:"generated_at"`
	Environment string        `json:"environment"`
	Target      string        `json:"target,omitempty"`
	Links       []PreviewLink `json:"links"`
}

PreviewManifest is the preview-links.json payload written during preview builds.

type RouteHookRunner

type RouteHookRunner interface {
	OnRoutesAssigned(*content.SiteGraph) error
}

RouteHookRunner represents post-routing hooks that must run before serving or rendering.

type TimedRouteHooks

type TimedRouteHooks struct {
	Hooks    site.RouteHooks
	Duration time.Duration
}

TimedRouteHooks wraps site route hooks and records how long they take.

func (*TimedRouteHooks) OnRoutesAssigned

func (h *TimedRouteHooks) OnRoutesAssigned(graph *content.SiteGraph) error

type TimingBreakdown

type TimingBreakdown struct {
	PluginConfig time.Duration
	Loader       time.Duration
	Router       time.Duration
	RouteHooks   time.Duration
	Assets       time.Duration
	Renderer     time.Duration
	Feed         time.Duration
}

TimingBreakdown records high-level build timings for diagnostics and doctor output.

func BuildFeedsWithTiming

func BuildFeedsWithTiming(cfg *config.Config, graph *content.SiteGraph) (TimingBreakdown, error)

BuildFeedsWithTiming runs feed generation and records its duration.

func BuildRendererWithTiming

func BuildRendererWithTiming(ctx context.Context, r *renderer.Renderer, graph *content.SiteGraph) (TimingBreakdown, error)

BuildRendererWithTiming runs the renderer build pass and records its timing.

func LoadGraphWithTiming

func LoadGraphWithTiming(ctx context.Context, loader site.Loader, resolver *router.Resolver, hooks site.RouteHooks) (*content.SiteGraph, TimingBreakdown, error)

LoadGraphWithTiming loads the site graph, assigns URLs, and records coarse timing for those stages.

Jump to

Keyboard shortcuts

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