You need at least Mill in version 0.6.0. Using the latest releases Mill version is recommended.
// build.sc
import mill._
import $ivy.`de.tototec::de.tobiasroeser.mill.jbake::0.3.1` // (1)
import de.tobiasroeser.mill.jbake._
object site extends JBakeModule {
def jbakeVersion = "2.6.7"
}
<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.7:0.3.1`
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
SubProcess
which is slower but is more robust. -
-
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.
- mill
-
Mill is a Scala-based open source build tool. In my opinion the best build tool for the JVM. It is fast, reliable and easy to understand.
- me
-
My name is Tobias Roeser and I’m a professional software developer and love to write and use open source software. I’m actively developing and maintaining Mill as well as several Mill plugins.
If you like my work, please star it on GitHub. You can also support me via GitHub Sponsors.
- Contributing
-
If you found a bug or have a feature request, please open a new issue on GitHub. I also accept pull requests on GitHub.
- Questions
-
You can also ask questions in the Mill discussions forum or in the Mill Gitter channel.
-
Made
SubProcess
the default process mode -
Fixed SubProcess worker for Windows
-
Fixed
jbakeServe
command for JBake newer than 2.6.2
-
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