static-site
Provider-neutral static-site scenario.
Installation
dagger install github.com/riftonix/daggerverse/scenarios/static-site@v0.4.0Entrypoint
Return Type
StaticSite !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory | - | Static site source directory |
| contentSources | [Directory ! ] | null | External content source directories |
| contentSourcePaths | [String ! ] | null | Paths selected within content sources |
| contentTargetPaths | [String ! ] | null | Content target paths within the site |
| contentContributors | [String ! ] | null | Contributor names for collision diagnostics |
| hugoImageRegistry | String | "ghcr.io" | Hugo image registry |
| hugoImageRepository | String | "riftonix/container-images/hugo-autoprefixer" | Hugo image repository |
| hugoImageTag | String | "0.165.0-10.5.5" | Hugo image tag |
| hugoContainerUserId | String | "65532" | Hugo container user |
| npmRegistry | String | null | Optional npm registry or proxy URL |
Example
dagger -m github.com/riftonix/daggerverse/scenarios/static-site@ca4badf370b32bee437d42fc1771172558945a07 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.
getContentMountCollisions() 🔗
Return content mount path collisions without failing.
Return Type
[String ! ] ! Example
dagger -m github.com/riftonix/daggerverse/scenarios/static-site@ca4badf370b32bee437d42fc1771172558945a07 call \
get-content-mount-collisionsfunc (m *MyModule) Example(ctx context.Context) []string {
return dag.
Staticsite().
Getcontentmountcollisions(ctx)
}@function
async def example() -> List[str]:
return await (
dag.static_site()
.getcontentmountcollisions()
)@func()
async example(): Promise<string[]> {
return dag
.staticSite()
.getContentMountCollisions()
}module() 🔗
Return the scenario name.
Return Type
String ! Example
dagger -m github.com/riftonix/daggerverse/scenarios/static-site@ca4badf370b32bee437d42fc1771172558945a07 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 |
|---|---|---|---|
| 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@ca4badf370b32bee437d42fc1771172558945a07 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(sitebaseurl: str, engine: str) -> dagger.Directory:
return (
dag.static_site()
.rendersite(sitebaseurl, engine)
)@func()
example(siteBaseUrl: string, engine: string): Directory {
return dag
.staticSite()
.renderSite(siteBaseUrl, engine)
}validateContentMounts() 🔗
Validate that content mounts do not overwrite target paths.
Return Type
String ! Example
dagger -m github.com/riftonix/daggerverse/scenarios/static-site@ca4badf370b32bee437d42fc1771172558945a07 call \
validate-content-mountsfunc (m *MyModule) Example(ctx context.Context) string {
return dag.
Staticsite().
Validatecontentmounts(ctx)
}@function
async def example() -> str:
return await (
dag.static_site()
.validatecontentmounts()
)@func()
async example(): Promise<string> {
return dag
.staticSite()
.validateContentMounts()
}verifySite() 🔗
Verify a static site with the selected engine.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| 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@ca4badf370b32bee437d42fc1771172558945a07 call \
verify-site --site-base-url string --engine stringfunc (m *MyModule) Example(ctx context.Context, siteBaseUrl string, engine string) string {
return dag.
Staticsite().
Verifysite(ctx, siteBaseUrl, engine)
}@function
async def example(sitebaseurl: str, engine: str) -> str:
return await (
dag.static_site()
.verifysite(sitebaseurl, engine)
)@func()
async example(siteBaseUrl: string, engine: string): Promise<string> {
return dag
.staticSite()
.verifySite(siteBaseUrl, engine)
}