A blog with static pages generated by jbake and hosted on Github.
jbake is a great framework, it lets you free to choose your tools for the:
- build automation (here Maven with jbake-maven-plugin),
- templating (here Groovy),
- look and feel (here Bootswatch).
This project is based on Y. Bonnel's blog, hosted here. The main changes from it are:
-
Use maven-scm-publish-plugin in place of Github Site Plugin: it works even if the Github user profile is not fully filled, see Pourquoi ce blog ? (in french).
-
Generate excerpts for the index and feed pages: it requires a helper class (in Xtend) and some scripts (in Groovy) inside the templates. Then no needs to fork jbake or
jbake-maven-plugin
. -
Share parameters between Maven and
jbake-maven-plugin
, with a little trick:properties-maven-plugin
is used to generate a filecustom.properties
(which usage is deprecated by jbake) filled with all the Maven properties.
There is an open request on this topic: adding system and pom properties to config object in templates #9 .
-
Update assets with Maven, using webjars: the Maven profile
webjars
will upgrade the libraries. -
Enforce the most recent libraries and plugin: the Maven profile
enforce
will do all the checking. -
Misc. (i18n, tag counters, escaped rss titles, ...)
- i18n: to be able to publish the same post in different languages.
- merge storing on Github with publishing using Travis.
- no more XML: Logback is already configurated with Groovy, now Polyglot for Maven can work with Groovy also.
Java 8 is required by the pom. But Java 7 should still work.
Maven 3.3.1 or above is required as Maven profiles are managed with maven-profiledep-extension. Still Maven 3.3 or below can be used: all the chained profiles must be specified on the command line, e.g. "-Pbootswatch-pathes -Pminify -Pwebjars
" in place of "-Pwebjars
".
To see the blog, go on Github gh-pages or on popsuite.
The posts are stored under src/jbake/content
.
They can be written with any of these formats: Markdown, AsciiDoc and HTML.
The jbake documentation is available here.
-
To update the assets (Bootswatch, SyntaxHighlighter, ...):
mvn clean process-resources -Pwebjars
With M2Eclipse, see launcherpop-tech_setup_webjars
. -
To get excerpt enhancement, popsuite-blog:pop-tech itself must have been installed in the local m2 repository, otherwise do it now:
mvn clean install
With M2Eclipse, see launcherpop-tech_clean_install
. -
To preview the changes:
mvn clean process-resources jbake:inline
and go to http://localhost:8083.
With M2Eclipse, see launcherpop-tech_clean_generate_inline
.
The port is defined by "jbake.port" in the pom file.
-
Before publishing, save the changes on Github.
-
To publish the changes:
mvn clean jbake:generate scm-publish:publish-scm
With M2Eclipse, see launcherpop-tech_clean_generate_publish
.
-
Blogguer sous GitHub avec JBake, Youri Ackx, 29/01/2014
-
Authoring your blog on GitHub with JBake and Gradle, Cédric Champeau, 03/02/2014
-
Migration de blogger à jbake, Yan Bonnel, 02/07/2014
-
Extract Webjars static resources with Gradle for jBake (or anything really...), Angel Ruiz, 31/08/2015
-
Integration of JBake in Maven – Static Websites, Lisa Pfisterer, 02/04/2015
-
Using JBake + Maven to post your blog on GitHub Pages, 06/04/2015
-
Baking Your Blog with JBake, Groovy and GitHub, Christopher J. Stehno, 02/09/2015
-
Thanks to Cédric Champeau and Yan Bonnel who have shared their blog code.
-
Photos : Chaval Brasil (CC BY-NC-ND 2.0)
-
Pop Tech posts are published under Creative Commons by-nc-sa 4.0.
-
Groovy templates and Java classes are under Apache 2 license.