Documentation
¶
Index ¶
- Constants
- func GetIndexFallback(ctx *generate.GenerateContext) *bool
- func SetSiteMetadata(ctx *generate.GenerateContext, outputDir, framework, assetsDir string, ...)
- type StaticfileConfig
- type StaticfileProvider
- func (p *StaticfileProvider) CleansePlan(buildPlan *plan.BuildPlan)
- func (p *StaticfileProvider) Detect(ctx *generate.GenerateContext) (bool, error)
- func (p *StaticfileProvider) Initialize(ctx *generate.GenerateContext) error
- func (p *StaticfileProvider) Name() string
- func (p *StaticfileProvider) Plan(ctx *generate.GenerateContext) error
- func (p *StaticfileProvider) StartCommandHelp() string
Constants ¶
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 (p *StaticfileProvider) Detect(ctx *generate.GenerateContext) (bool, error)
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 (p *StaticfileProvider) Plan(ctx *generate.GenerateContext) error
func (*StaticfileProvider) StartCommandHelp ¶ added in v0.0.28
func (p *StaticfileProvider) StartCommandHelp() string