Dagger
Search

static-site

Provider-neutral static-site scenario.

Installation

dagger install github.com/riftonix/daggerverse/scenarios/static-site@2ab5cda99db7f7171cd871f497a3b2a3bca88511

Entrypoint

Return Type
StaticSite !
Example
dagger -m github.com/riftonix/daggerverse/scenarios/static-site@2ab5cda99db7f7171cd871f497a3b2a3bca88511 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
NameTypeDefault ValueDescription
configFile !-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@2ab5cda99db7f7171cd871f497a3b2a3bca88511 call \
 get-hugo-mount-collisions --config file:path
func (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@2ab5cda99db7f7171cd871f497a3b2a3bca88511 call \
 module
func (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
NameTypeDefault ValueDescription
siteDirectory -Static site source directory
siteBaseUrlString !-Base URL to render the site with
engineString !"hugo"Static-site engine to use
Example
dagger -m github.com/riftonix/daggerverse/scenarios/static-site@2ab5cda99db7f7171cd871f497a3b2a3bca88511 call \
 render-site --site-base-url string --engine string
func (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
NameTypeDefault ValueDescription
configFile !-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@2ab5cda99db7f7171cd871f497a3b2a3bca88511 call \
 validate-hugo-mounts --config file:path
func (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
NameTypeDefault ValueDescription
siteDirectory -Static site source directory
siteBaseUrlString !-Base URL to render and validate the site with
engineString !"hugo"Static-site engine to use
Example
dagger -m github.com/riftonix/daggerverse/scenarios/static-site@2ab5cda99db7f7171cd871f497a3b2a3bca88511 call \
 verify-site --site-base-url string --engine string
func (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)
}