Hugo
Description
This plugin enables you generate a static website using Hugo in a pipeline.
Source Code: https://github.com/go-vela/vela-hugo
Registry: https://hub.docker.com/r/target/vela-hugo
Usage
NOTE:
Users should refrain from using latest as the tag for the Docker image.
It is recommended to use a semantically versioned tag instead.
Sample of building a site:
steps:
  - name: hugo
    image: target/vela-hugo:latest
    pull: always
    parameters:
      theme_name: hugo-theme-learn
Sample of building a site using the docsy theme:
steps:
  - name: hugo
    image: target/vela-hugo:latest
    pull: always
    parameters:
-     theme_name: hugo-theme-learn
+     theme_name: docsy
Sample of building a site using a custom version of Hugo:
steps:
  - name: hugo
    image: target/vela-hugo:latest
    pull: always
    parameters:
      theme_name: hugo-theme-learn
+     version: 0.101.0
Sample of building a site using the extended hugo binary:
NOTE: Some themes may require the extended binary for additional functionality.
steps:
  - name: hugo
    image: target/vela-hugo:latest
    pull: always
    parameters:
      theme_name: hugo-theme-learn
+     extended: true
Sample of using an environment to build the site differently depending on configuration:
NOTE: Please see Hugo documentation for how to configure this properly.
steps:
  - name: hugo
    image: target/vela-hugo:latest
    pull: always
    parameters:
      theme_name: hugo-theme-learn
+     environment: dev
Sample of using multiple themes via configuration file:
NOTE: Please see Hugo documentation for how to configure this properly.
steps:
  - name: hugo
    image: target/vela-hugo:latest
    pull: always
    parameters:
      config_file: config.toml
Parameters
NOTE:
The plugin supports reading all parameters via environment variables or files.
Any values set from a file take precedence over values set from the environment.
The following parameters are used to configure the image:
| Name | Description | Required | Default | Environment Variables | 
|---|---|---|---|---|
base_url | hostname (and path) to the root, e.g. http://spf13.com/ | false | N/A | PARAMETER_BASE_URLHUGO_BASE_URL | 
cache_directory | filesystem path to cache directory | false | N/A | PARAMETER_CACHE_DIRECTORYHUGO_CACHE_DIRECTORY | 
content_directory | filesystem path to content directory | false | N/A | PARAMETER_CONTENT_DIRECTORYHUGO_CONTENT_DIRECTORY | 
config_directory | filesystem path to config directory | false | config | PARAMETER_CONFIG_DIRECTORYHUGO_CONFIG_DIRECTORY | 
config_file | config file to use from config directory (supports: json,toml,yaml) | false | N/A | PARAMETER_CONFIG_FILEHUGO_CONFIG_FILE | 
draft | include content marked as draft | false | false | PARAMETER_DRAFTHUGO_DRAFT | 
environment | target build environment, located in the config directory | false | N/A | PARAMETER_ENVIRONMENTHUGO_ENVIRONMENT | 
expired | include expired content | false | false | PARAMETER_EXPIREDHUGO_EXPIRED | 
extended | whether to use the extended hugo binary | false | false | PARAMETER_EXTENDEDHUGO_EXTENDED | 
future | include content with publish date in the future | false | false | PARAMETER_FUTUREHUGO_FUTURE | 
layout_directory | filesystem path to layout directory | false | N/A | PARAMETER_LAYOUT_DIRECTORYHUGO_LAYOUT_DIRECTORY | 
log_level | set the log level for the plugin | true | info | PARAMETER_LOG_LEVELHUGO_LOG_LEVEL | 
output_directory | filesystem path to write files to | false | N/A | PARAMETER_OUTPUT_DIRECTORYHUGO_OUTPUT_DIRECTORY | 
source_directory | filesystem path to read files relative from | false | N/A | PARAMETER_SOURCE_DIRECTORYHUGO_SOURCE_DIRECTORY | 
theme_name | theme to use from theme directory | false | N/A | PARAMETER_THEME_NAMEHUGO_THEME_NAME | 
theme_directory | filesystem path to themes directory | false | themes | PARAMETER_THEME_DIRECTORYHUGO_THEME_DIRECTORY | 
version | the version of hugo the plugin should use | false | 0.101.0 | PARAMETER_VERSIONHUGO_VERSION | 
Template
COMING SOON!
Troubleshooting
You can start troubleshooting this plugin by tuning the level of logs being displayed:
steps:
  - name: hugo
    image: target/vela-hugo:latest
    pull: always
    parameters:
+     log_level: trace
      theme_name: hugo-theme-learn
Below are a list of common problems and how to solve them: