staticfile

package
v0.45.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: MIT Imports: 6 Imported by: 1 module, 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

Index

Constants

View Source
const (
	StaticfileConfigName = "Staticfile"
	CaddyfilePath        = "Caddyfile"
)

Variables

This section is empty.

Functions

func GetIndexFallback added in v0.29.0

func GetIndexFallback(ctx *generate.GenerateContext) *bool

returns index_fallback from a Staticfile when explicitly set we use a bool pointer so we can indicate that no user default was set with a nil return value

func SetSiteMetadata added in v0.44.0

func SetSiteMetadata(ctx *generate.GenerateContext, outputDir, framework, assetsDir string, indexFallback bool)

Records where a static site's files are in the final image and how they should be served, so Railway can serve the site from its edge instead of from a running container.

outputDir is the absolute path Caddy serves from. assetsDir is the directory, relative to outputDir, where the framework writes files with a content hash in their name; it is empty when the framework has no such directory.

Types

type StaticfileConfig

type StaticfileConfig struct {
	RootDir string `yaml:"root"`
	// IndexFallback controls whether to fall back to index.html for unmatched routes (default: true)
	IndexFallback *bool `yaml:"index_fallback"`
}

Staticfile in a directory is parsed into this structure

type StaticfileProvider

type StaticfileProvider struct{}

func (*StaticfileProvider) CleansePlan added in v0.13.0

func (p *StaticfileProvider) CleansePlan(buildPlan *plan.BuildPlan)

func (*StaticfileProvider) Detect

func (*StaticfileProvider) Initialize added in v0.0.23

func (p *StaticfileProvider) Initialize(ctx *generate.GenerateContext) error

func (*StaticfileProvider) Name

func (p *StaticfileProvider) Name() string

func (*StaticfileProvider) Plan

func (*StaticfileProvider) StartCommandHelp added in v0.0.28

func (p *StaticfileProvider) StartCommandHelp() string

Jump to

Keyboard shortcuts

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