asciidoc-blog-maven-plugin

Maven plugin to generate asciidoc file from multiple files to get a blog from asciidoc. Those files finally can be rendered to html e.g. using the maven site plugin.

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

de.steffen-rumpf
ArtifactId

ArtifactId

asciidoc-blog-maven-plugin
Last Version

Last Version

1.0
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

asciidoc-blog-maven-plugin
Maven plugin to generate asciidoc file from multiple files to get a blog from asciidoc. Those files finally can be rendered to html e.g. using the maven site plugin.
Project URL

Project URL

http://www.steffen-rumpf.de
Source Code Management

Source Code Management

http://github.com/steffakasid/asciidoc-blog-maven-plugin/tree/master

Download asciidoc-blog-maven-plugin

How to add to project

<plugin>
    <groupId>de.steffen-rumpf</groupId>
    <artifactId>asciidoc-blog-maven-plugin</artifactId>
    <version>1.0</version>
</plugin>

Dependencies

compile (4)

Group / Artifact Type Version
commons-io : commons-io jar 2.6
org.asciidoctor : asciidoctorj jar 2.3.0
org.slf4j : slf4j-api jar 1.7.5
org.slf4j : slf4j-simple jar 1.6.4

provided (4)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 3.6.3
org.apache.maven : maven-core jar 3.6.3
org.apache.maven : maven-artifact jar 3.6.3
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.6.0

test (3)

Group / Artifact Type Version
org.apache.maven : maven-compat jar 3.6.3
junit : junit jar 4.13
org.apache.maven.plugin-testing : maven-plugin-testing-harness jar 3.3.0

Project Modules

There are no modules declared in this project.

asciidoc-blog-maven-plugin

Introduction

I searched for a way to use the maven-site plugin somehow in a blog like way. That means I wanted to have multiple article/ blog post files which should then be generated into on single html static content page. I didn’t find a way to do this with the maven-site plugin directly so I decided to create a simple maven plugin which could read a YAML file which basically defines the blog posts and generates a main page from this. Also a simple paging is included into the plugin.

Build

$ mvn clean install

Release

$ mvn release:clean
$ mvn release:prepare
$ mvn release:perform

Usage

Add the following to your pom of a maven-site project:

<plugin>
    <groupId>de.steffenrumpf</groupId>
    <artifactId>asciidoc-template-maven-plugin</artifactId>
    <version>1.0-SNAPSHOT</version>
    <configuration>
        <definitionFileName>article_definition.yml</definitionFileName>
        <outputFile>index</outputFile>
        <pageSize>10</pageSize>
    </configuration>
    <executions>
        <execution>
        <phase>generate-sources</phase>
        <goals>
            <goal>generate_blog_posts</goal>
        </goals>
        </execution>
    </executions>
</plugin>

Structure of article definition YAML file

Blog post must be just placed below src/site/ in a typicall maven project. The files can also be structured in folders. Every asciidoc file must define the following metadata:

:post-date: 25-11-20

The post-date will be used to bring all posts into order.

Example Site

My website http://www.steffen-rumpf.de is created using this plugin. The full code can also be found on github.

Versions

Version
1.0