Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lefou/mill-jbake

JBake Plugin for Mill
https://github.com/lefou/mill-jbake

jbake mill mill-module mill-plugin scala

Last synced: 10 days ago
JSON representation

JBake Plugin for Mill

Awesome Lists containing this project

README

        

= JBake plugin for Mill Build Tool
:version: 0.3.1
:min-mill-version: 0.6.0
:example-mill-version: 0.11.6
:example-jbake-version: 2.6.7
:project-home: https://github.com/lefou/mill-jbake
:mill-home: https://github.com/com-lihaoyi/mill
:jbake-home: https://jbake.org/

ifdef::env-github[]
image:https://github.com/lefou/mill-jbake/actions/workflows/actions.yml/badge.svg["GitHub Actions", link="https://github.com/lefou/mill-jbake/actions/workflows/actions.yml"]
image:https://javadoc.io/badge2/de.tototec/de.tobiasroeser.mill.jbake_mill0.10_2.13/javadoc.svg["javadoc", link="https://javadoc.io/doc/de.tototec/de.tobiasroeser.mill.jbake_mill0.10_2.13"]
image:https://index.scala-lang.org/lefou/mill-jbake/de.tobiasroeser.mill.jbake_mill0.10/latest.svg["de.tobiasroeser.mill.jbake_mill0.10", link="https://index.scala-lang.org/lefou/mill-jbake/de.tobiasroeser.mill.jbake_mill0.10"]
endif::[]

{mill-home}[Mill] plugin to create static sites/blogs with {jbake-home}[JBake].

JBake runs completely on the JVM and supports different template engines and various markup formats, including AsciiDoc(tor).

== Quickstart

You need at least Mill in version {min-mill-version}. Using the latest releases Mill version is recommended.

[source,scala,subs="verbatim,attributes"]
----
// build.sc
import mill._
import $ivy.`de.tototec::de.tobiasroeser.mill.jbake::{version}` // <1>
import de.tobiasroeser.mill.jbake._

object site extends JBakeModule {

def jbakeVersion = "{example-jbake-version}"

}
----
<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:
[source,scala,subs="verbatim,attributes"]
----
import $ivy.`de.tototec::de.tobiasroeser.mill.jbake_mill0.7:{version}`
----

Generate the site:

[source,sh]
----
sh> mill site.jbake
----

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

[source,sh]
----
sh> mill site.jbakeServe
----

== Configuration and Targets

To use the mill-jbake plugin, you have to extends link:jbake/src/de/tobiasroeser/mill/jbake/JBakeModule.scala[`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 `SubProcess` which is slower but is more robust.
--

.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 https://www.apache.org/licenses/LICENSE-2.0[Apache License, Version 2.0].

== About

mill::
{mill-home}[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 https://github.com/lefou/[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 https://github.com/lefou?utf8=%E2%9C%93&tab=repositories&q=topic%3Amill&type=&language=[several Mill plugins].

If you like my work, please star it on GitHub. You can also support me via https://github.com/sponsors/lefou[GitHub Sponsors].
--

Contributing::
If you found a bug or have a feature request, please open a {project-home}/issues[new issue on GitHub].
I also accept {project-home}/pulls[pull requests on GitHub].

Questions::
You can also ask questions in the {mill-home}/discussions[Mill discussions forum] or in the https://gitter.im/lihaoyi/mill[Mill Gitter channel].

== Changelog

=== 0.3.1 - 2023-11-24

* Added support for Mill 0.11
* Build with Mill 0.11

=== 0.3.0 - 2022-05-12

* Made `SubProcess` the default process mode
* Fixed SubProcess worker for Windows
* Fixed `jbakeServe` command for JBake newer than 2.6.2

=== 0.2.2 - 2022-05-09

* 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

=== 0.2.1 - 2020-02-28

* Fixed `jbakeInit` command
* Version bump mill API to 0.6.0

=== 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

=== 0.1.0 - 2019-02-17

* Initial public release