hugo
This module has been generated via dagger init and serves as a reference tobasic module structure as you get started with Dagger.
Two functions have been pre-created. You can modify, delete, or add to them,
as needed. They demonstrate usage of arguments and return types using simple
echo and grep commands. The functions can be called from the dagger CLI or
from one of the SDKs.
The first line in this comment block is a short description line and the
rest is a long description with more detail on the module's purpose or usage,
if appropriate. All modules should have a short description.
Installation
dagger install github.com/riftonix/daggerverse/modules/hugo@v0.2.0Entrypoint
Return Type
Hugo !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory | - | Hugo site directory |
| imageRegistry | String | "ghcr.io" | Hugo image registry |
| imageRepository | String | "riftonix/container-images/hugo-autoprefixer" | Hugo image repository |
| imageTag | String | "0.154.5-10.5.0" | Hugo image tag |
| userId | String | "65532" | Hugo image user |
Example
dagger -m github.com/riftonix/daggerverse/modules/hugo@004301e80e7e47e53bb494c8c079f2c6ab0d7f85 call \
func (m *MyModule) Example() *dagger.Hugo {
return dag.
Hugo()
}@function
def example() -> dagger.Hugo:
return (
dag.hugo()
)@func()
example(): Hugo {
return dag
.hugo()
}Types
Hugo 🔗
build() 🔗
Build Hugo site and return the public directory
Return Type
Directory !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| hugoThemeUrl | String ! | - | Hugo theme module URL |
| siteBaseUrl | String ! | - | Site base URL for Hugo |
Example
dagger -m github.com/riftonix/daggerverse/modules/hugo@004301e80e7e47e53bb494c8c079f2c6ab0d7f85 call \
build --hugo-theme-url string --site-base-url stringfunc (m *MyModule) Example(hugoThemeUrl string, siteBaseUrl string) *dagger.Directory {
return dag.
Hugo().
Build(hugoThemeUrl, siteBaseUrl)
}@function
def example(hugo_theme_url: str, site_base_url: str) -> dagger.Directory:
return (
dag.hugo()
.build(hugo_theme_url, site_base_url)
)@func()
example(hugoThemeUrl: string, siteBaseUrl: string): Directory {
return dag
.hugo()
.build(hugoThemeUrl, siteBaseUrl)
}container() 🔗
Creates container with configured Hugo
Return Type
Container ! Example
dagger -m github.com/riftonix/daggerverse/modules/hugo@004301e80e7e47e53bb494c8c079f2c6ab0d7f85 call \
containerfunc (m *MyModule) Example() *dagger.Container {
return dag.
Hugo().
Container()
}@function
def example() -> dagger.Container:
return (
dag.hugo()
.container()
)@func()
example(): Container {
return dag
.hugo()
.container()
}initModule() 🔗
Initialize Hugo module metadata without rendering a static site.
Return Type
Directory !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| modulePath | String ! | - | Go module path for the Hugo module |
Example
dagger -m github.com/riftonix/daggerverse/modules/hugo@004301e80e7e47e53bb494c8c079f2c6ab0d7f85 call \
init-module --module-path stringfunc (m *MyModule) Example(modulePath string) *dagger.Directory {
return dag.
Hugo().
InitModule(modulePath)
}@function
def example(module_path: str) -> dagger.Directory:
return (
dag.hugo()
.init_module(module_path)
)@func()
example(modulePath: string): Directory {
return dag
.hugo()
.initModule(modulePath)
}prepareModule() 🔗
Resolve Hugo module dependencies without rendering a static site.
Return Type
Directory !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| hugoModuleUrl | String | null | Optional Hugo module URL to resolve, for example github.com/google/docsy@v0.13.0 |
Example
dagger -m github.com/riftonix/daggerverse/modules/hugo@004301e80e7e47e53bb494c8c079f2c6ab0d7f85 call \
prepare-modulefunc (m *MyModule) Example() *dagger.Directory {
return dag.
Hugo().
PrepareModule()
}@function
def example() -> dagger.Directory:
return (
dag.hugo()
.prepare_module()
)@func()
example(): Directory {
return dag
.hugo()
.prepareModule()
}validate() 🔗
Validate Hugo site configuration and strict rendering.
Return Type
String !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| hugoThemeUrl | String ! | - | Hugo theme module URL |
| siteBaseUrl | String ! | - | Site base URL for Hugo |
Example
dagger -m github.com/riftonix/daggerverse/modules/hugo@004301e80e7e47e53bb494c8c079f2c6ab0d7f85 call \
validate --hugo-theme-url string --site-base-url stringfunc (m *MyModule) Example(ctx context.Context, hugoThemeUrl string, siteBaseUrl string) string {
return dag.
Hugo().
Validate(ctx, hugoThemeUrl, siteBaseUrl)
}@function
async def example(hugo_theme_url: str, site_base_url: str) -> str:
return await (
dag.hugo()
.validate(hugo_theme_url, site_base_url)
)@func()
async example(hugoThemeUrl: string, siteBaseUrl: string): Promise<string> {
return dag
.hugo()
.validate(hugoThemeUrl, siteBaseUrl)
}