Mill plugin to create static sites/blogs with JBake.
JBake runs completely on the JVM and supports many different template engines and various markup formats, including AsciiDoc(tor).
You need at least Mill 0.6.0. Using the latest releases Mill version is recommended.
// build.sc
import mill._
import $ivy.`de.tototec::de.tobiasroeser.mill.jbake::0.2.2` // (1)
import de.tobiasroeser.mill.jbake._
object site extends JBakeModule {
def jbakeVersion = "2.6.4"
}
<1>: Import the mill-jbake plugin for the correct Mill platform.
If you are using an older Mill verion (< 0.9.9
), you need to add the platform suffix yourself. E.g. to use it with Mill 0.7, your import looks like:
import $ivy.`de.tototec::de.tobiasroeser.mill.jbake_mill0.6:0.2.2`
Generate the site:
sh> mill site.jbake
Start a local Web-Server on Port 8820 with the generated site:
sh> mill site.jbakeServe
To use the mill-jbake plugin, you have to extends de.tobiasroeser.mill.jbake.JBakeModule
.
-
def jbakeVersion: T[String]
- The JBake version to be used. Official release versions down to 2.2.0 are supported out of the box. If you need other version or local installation, you need also to customizejbakeDistributionZip
orjbakeDistributionDir
.
-
def sources: Sources
- The directory containing the JBake source files (assets
,content
,templates
). Defaults tosrc
. -
def jbakeDistributionZip: T[PathRef]
- The JBake Binary Distribution ZIP archive. Defaults to downloading the distribution file from Bintray. -
def jbakeDistributionDir: T[PathRef]
- The unpacked JBake Distribution. Defaults to the unpacked content of thejbakeDistributionZip
. -
def jbakeClasspath: T[Seq[PathRef]]
- The classpath used to run the JBake site generator. -
def jbakeProcessMode: ProcessMode
- Specify how the JBake tool should be executed.Supported value:
-
ClassLoader
runs JBake in s isolated classpath in the same JVM. -
SubProcess
spawns a new Java sub-process of each JBake tool invokation.
Defaults to
ClassLoader
which is also faster. If you experience stability or out-of-memory issues, try to change this toSubProcess
. -
-
def jbake: T[PathRef]
- Bake the site with JBake. -
def jbakeServe(): Command[Unit]
- Starts a local Webserver to serve the content created withjbake
. -
def jbakeRun(args: String*): Command[Unit]
- Just calls the jbake tool with the given arguments. This might be helpful, if you need to run JBake with different options.
mill-jbake is published under the Apache License, Version 2.0.
-
Support for newer Mill version up to
0.10.x
via cross building -
Replaced CI system with GitHub Actions
-
Updated JBake download URL, which changed upstream
-
Use a worker process to run JBake
-
Added new ClassLoader based JBake worker, to speed up repetitive runs
-
Added new `jbakeRun`target to just run the JBake tool with arbitrary arguments