JBake plugin for mill

Travis-CI Build Status

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).

Quickstart

// build.sc
import mill._
import $ivy.`de.tototec::de.tobiasroeser.mill.jbake:0.2.1`
import de.tobiasroeser.mill.jbake._

object site extends JBakeModule {

  def jbakeVersion = "2.6.4"

}

Generate the site:

sh> mill site.jbake

Start a local Web-Server on Port 8820 with the generated site:

sh> mill site.jbakeServe

Configuration and Targets

To use the mill-jbake plugin, you have to extends de.tobiasroeser.mill.jbake.JBakeModule.

Mandatory Configuration
  • 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 customize jbakeDistributionZip or jbakeDistributionDir.

Optional Configuration
  • def sources: Sources - The directory containing the JBake source files (assets, content, templates). Defaults to src.

  • 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 the jbakeDistributionZip.

  • 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 to SubProcess.

Commands
  • def jbake: T[PathRef] - Bake the site with JBake.

  • def jbakeServe(): Command[Unit] - Starts a local Webserver to serve the content created with jbake.

  • 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.

License

mill-jbake is published under the Apache License, Version 2.0.

Changelog

mill-jbake 0.2.1 - 2020-02-28

  • Fixed jbakeInit command

  • Version bump mill API to 0.6.0

mill-jbake 0.2.0 - 2019-02-19

  • 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

mill-jbake 0.1.0 - 2019-02-17

  • Initial public release