Advanced Usage

Here are listed examples of a more advanced usage.

Running a Site Generator on Multiple Source Directories

If you need to run a generator on more than one source directory, bypassing the AutoPlugin system and defining one or more sbt Configurations is necessary. For example, suppose you have two Paradox source directories and want them each generated as a subdirectory under target/site. A build.sbt might look something like this:

// Define two `Configuration` instances.
val Site1 = config("site1")
val Site2 = config("site2")

// Apply the default Paradox settings to the `Site1` config
ParadoxPlugin.paradoxSettings(Site1)
ParadoxSitePlugin.paradoxSettings(Site1)

// Customize the source directory
sourceDirectory in (Site1, paradox) := sourceDirectory.value / "paradox-site-1"

// Customize the output subdirectory
siteSubdirName in Site1 := "chapter1"

// Same as above, but for config `Site2` keep the default source directory
ParadoxPlugin.paradoxSettings(Site2)
ParadoxSitePlugin.paradoxSettings(Site2)
siteSubdirName in Site2 := "chapter2"

// Global Paradox settings
enablePlugins(ParadoxPlugin)
paradoxTheme := Some(builtinParadoxTheme("generic"))

The other generators follow a similar pattern, e.g. JekyllPlugin.jekyllSettings(config("foo")).