Hugo

The sbt-site plugin has support for building Hugo projects. To enable Hugo site generation, simply enable the associated plugin in your build.sbt file:

The Hugo integration is not (yet) included in this version of sbt-site.

sourceenablePlugins(HugoPlugin)

The hugo binary must be installed on your $PATH in order to be accessible to sbt-site. In addition, this plugin assumes you have a Hugo project under the src/hugo directory. To change this, set the sourceDirectory key in the Hugo scope:

Hugo / sourceDirectory := sourceDirectory.value / "doc"

You may also change the base-url that gets passed to the hugo command by adjusting the following setting:

sourceHugo / baseURL := uri("https://yourdomain.com")

To export environment variables when forking the hugo process, for example to render with Hugo’s getenv function, use:

sourceHugo / extraEnv := Map("MY_ENV" -> "Is set!", "MY_OTHER_ENV" -> "Is also set.")