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 Configuration
s 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:
source// 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
Site1 / paradox / sourceDirectory := sourceDirectory.value / "paradox-site-1"
// Customize the output subdirectory
Site1 / siteSubdirName := "chapter1"
// Same as above, but for config `Site2` keep the default source directory
ParadoxPlugin.paradoxSettings(Site2)
ParadoxSitePlugin.paradoxSettings(Site2)
Site2 / siteSubdirName := "chapter2"
// Global Paradox settings
enablePlugins(ParadoxPlugin)
paradoxTheme := Some(builtinParadoxTheme("generic"))
The other generators follow a similar pattern, e.g. JekyllPlugin.jekyllSettings(config("foo"))
.
1.5.0