Skip to content

vigojug/jbake-gradle-plugin

 
 

Repository files navigation

JBake plugin for Gradle

Build Status Coverage Status Apache License 2 download


This plugin allows rendering a site using JBake directly from Gradle.

Examples

Usage

This is work in progress

plugins {
    id 'me.champeau.jbake' version '0.3.0-SNAPSHOT'
}

This will add a bake task to your build, which will search for a standard JBake source tree in src/jbake and generate content into $buildDir/jbake (typically build/jbake).

Warning
versions prior to 0.3.0 had a task named jbake. This task has been renamed to bake since 0.3.0.

Configuration

Plugin configuration

The default input and output directories can be changed using the jbake configuration block:

jbake {
    srcDirName  = 'jbake-sources'
    destDirName = 'output'
}

The generated output can then be found at $buildDir/output.

The Version could be changed too:

jbake {
    version  = '2.3.0'
}

The default is 2.5.1.

Render Engine configuration

Jbake uses several engines. The library versions could be changed too:

jbake {
    pegdownVersion = '1.6.0'
    freemarkerVersion = '2.3.25-incubating'
    groovyTemplatesVersion = '2.4.7'
    jade4jVersion = '1.2.3'
    thymeleafVersion = '3.0.2.RELEASE'
    asciidoctorJavaIntegrationVersion = '0.1.4'
    asciidoctorjVersion = '1.5.4.1'
}

Notice the asciidoctorJavaIntegrationVersion and asciidoctorjVersion. Since Version 2.3.1 jbake has changed to the asciidoctorj library.

This plugin handles this change internally. If you use a Version > 2.3.0 of jbake, the dependency switch to the new one.

JBake configuration

There are several options to configure JBake. One is to have the regular jbake.properties file into the source directory. The other is to use the plugin configuration block:

jbake {
   configuration['template.post.file'] = 'mypost.ftl'
}

Repositories configuration

The plugin will automatically include jcenter() as a repository in order to resolve JBake and template engine dependencies. You may deactivate this feature by setting includeDefaultRepositories to false, like so

jbake {
   includeDefaultRepositories = false
}
Warning
You must still define at least one repository from where all JBake and template engine dependencies should be resolved. Failure to do so will result in a build error.

About

A Gradle plugin for JBake

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 49.0%
  • Groovy 47.6%
  • HTML 3.4%