static-site
Provider-neutral static-site scenario.
Installation
dagger install github.com/riftonix/daggerverse/scenarios/static-site@220e6ffd361648988bea4beb94c3a602f38cfdfeEntrypoint
Return Type
StaticSite ! Example
dagger -m github.com/riftonix/daggerverse/scenarios/static-site@220e6ffd361648988bea4beb94c3a602f38cfdfe call \
func (m *MyModule) Example() *dagger.StaticSite {
return dag.
StaticSite()
}@function
def example() -> dagger.StaticSite:
return (
dag.static_site()
)@func()
example(): StaticSite {
return dag
.staticSite()
}Types
StaticSite 🔗
Static-site scenario entrypoint.
getHugoMountCollisions() 🔗
Return Hugo virtual mount path collisions without failing.
Return Type
[String ! ] !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| config | File ! | - | Hugo YAML config file containing module imports and mounts |
| modules | [Directory ! ] ! | - | Imported module roots in the same order as module.imports in the config |
Example
dagger -m github.com/riftonix/daggerverse/scenarios/static-site@220e6ffd361648988bea4beb94c3a602f38cfdfe call \
get-hugo-mount-collisions --config file:pathfunc (m *MyModule) Example(ctx context.Context, config *dagger.File, modules []*dagger.Directory) []string {
return dag.
StaticSite().
GetHugoMountCollisions(ctx, config, modules)
}@function
async def example(config: dagger.File, modules: List[dagger.Directory]) -> List[str]:
return await (
dag.static_site()
.get_hugo_mount_collisions(config, modules)
)@func()
async example(config: File, modules: Directory[]): Promise<string[]> {
return dag
.staticSite()
.getHugoMountCollisions(config, modules)
}module() 🔗
Return the scenario name.
Return Type
String ! Example
dagger -m github.com/riftonix/daggerverse/scenarios/static-site@220e6ffd361648988bea4beb94c3a602f38cfdfe call \
modulefunc (m *MyModule) Example(ctx context.Context) string {
return dag.
StaticSite().
Module(ctx)
}@function
async def example() -> str:
return await (
dag.static_site()
.module()
)@func()
async example(): Promise<string> {
return dag
.staticSite()
.module()
}renderSite() 🔗
Render a static site with the selected engine.
Return Type
Directory !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| site | Directory | - | Static site source directory |
| siteBaseUrl | String ! | - | Base URL to render the site with |
| engine | String ! | "hugo" | Static-site engine to use |
Example
dagger -m github.com/riftonix/daggerverse/scenarios/static-site@220e6ffd361648988bea4beb94c3a602f38cfdfe call \
render-site --site-base-url string --engine stringfunc (m *MyModule) Example(siteBaseUrl string, engine string) *dagger.Directory {
return dag.
StaticSite().
RenderSite(siteBaseUrl, engine)
}@function
def example(site_base_url: str, engine: str) -> dagger.Directory:
return (
dag.static_site()
.render_site(site_base_url, engine)
)@func()
example(siteBaseUrl: string, engine: string): Directory {
return dag
.staticSite()
.renderSite(siteBaseUrl, engine)
}validateHugoMounts() 🔗
Validate that Hugo imports do not overwrite shared virtual paths.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| config | File ! | - | Hugo YAML config file containing module imports and mounts |
| modules | [Directory ! ] ! | - | Imported module roots in the same order as module.imports in the config |
Example
dagger -m github.com/riftonix/daggerverse/scenarios/static-site@220e6ffd361648988bea4beb94c3a602f38cfdfe call \
validate-hugo-mounts --config file:pathfunc (m *MyModule) Example(ctx context.Context, config *dagger.File, modules []*dagger.Directory) string {
return dag.
StaticSite().
ValidateHugoMounts(ctx, config, modules)
}@function
async def example(config: dagger.File, modules: List[dagger.Directory]) -> str:
return await (
dag.static_site()
.validate_hugo_mounts(config, modules)
)@func()
async example(config: File, modules: Directory[]): Promise<string> {
return dag
.staticSite()
.validateHugoMounts(config, modules)
}verifySite() 🔗
Verify a static site with the selected engine.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| site | Directory | - | Static site source directory |
| siteBaseUrl | String ! | - | Base URL to render and validate the site with |
| engine | String ! | "hugo" | Static-site engine to use |
Example
dagger -m github.com/riftonix/daggerverse/scenarios/static-site@220e6ffd361648988bea4beb94c3a602f38cfdfe call \
verify-site --site-base-url string --engine stringfunc (m *MyModule) Example(ctx context.Context, siteBaseUrl string, engine string) string {
return dag.
StaticSite().
VerifySite(ctxsiteBaseUrl, engine)
}@function
async def example(site_base_url: str, engine: str) -> str:
return await (
dag.static_site()
.verify_site(site_base_url, engine)
)@func()
async example(siteBaseUrl: string, engine: string): Promise<string> {
return dag
.staticSite()
.verifySite(siteBaseUrl, engine)
}