Documentation
¶
Overview ¶
Package sitetpl expands the {{…}} placeholders a framework definition may use in env vars, setup steps, and commands, so the store can declare a per-site value (a base URL, a database name) without lerd knowing the framework.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply replaces {{site}}, {{site_testing}}, {{bucket}}, {{domain}}, {{scheme}}, and the {{<service>_version}} placeholders in s.
func DBName ¶
DBName returns the database handle for the project at path: the site's slug, or the group main's database when the site is a shared-DB group secondary.
func ExpandCommands ¶
func ExpandCommands(cmds []config.FrameworkCommand, ctx Ctx) []config.FrameworkCommand
ExpandCommands returns cmds with placeholders expanded in each shell string.
Types ¶
type Ctx ¶
type Ctx struct {
Site string // database / handle name (underscored)
Bucket string // S3-safe bucket name (lowercase, hyphens)
Domain string // primary domain (e.g. myapp.test)
Scheme string // "http" or "https"
}
Ctx holds the values available to placeholders. An empty field leaves its placeholder untouched rather than substituting an empty string.