Markdown Static Site Generator

A very simple markdown static site generator

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

com.kstruct
ArtifactId

ArtifactId

markdown-static-site-generator-maven-plugin
Last Version

Last Version

0.0.6
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

Markdown Static Site Generator
A very simple markdown static site generator
Project URL

Project URL

https://github.com/mattsheppard/markdown-static-site-generator
Source Code Management

Source Code Management

http://github.com/mattsheppard/markdown-static-site-generator/tree/master

Download markdown-static-site-generator-maven-plugin

How to add to project

<plugin>
    <groupId>com.kstruct</groupId>
    <artifactId>markdown-static-site-generator-maven-plugin</artifactId>
    <version>0.0.6</version>
</plugin>

Dependencies

compile (6)

Group / Artifact Type Version
org.freemarker : freemarker jar 2.3.25-incubating
com.atlassian.commonmark : commonmark jar 0.7.1
com.atlassian.commonmark : commonmark-ext-gfm-tables jar 0.7.1
com.atlassian.commonmark : commonmark-ext-yaml-front-matter jar 0.7.1
org.projectlombok : lombok jar 1.16.10
org.apache.maven : maven-plugin-api jar 3.3.9

provided (1)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.4

test (3)

Group / Artifact Type Version
com.google.jimfs : jimfs jar 1.1
junit : junit jar 4.12
org.mockito : mockito-core jar 2.1.0-RC.1

Project Modules

There are no modules declared in this project.

markdown-static-site-generator

A simple maven plugin that takes a directory of markdown files (and resource files) and produces a static website. We expect commonmark style markdown syntax, and use the freemarker templating language to wrap the generated pages.

So, how do I use it?

So, it's not in maven cerntral for now (will have to find out how to do that sometime), so you'll first need to clone it, then mvn install it locally.

Once you've got it available, you install it as a maven plugin on a project with something like this:

<project>
...
    <build>
...
        <plugins>
...
            <plugin>
                <groupId>com.kstruct</groupId>
                <artifactId>markdown-static-site-generator-maven-plugin</artifactId>
                <version>0.0.1-SNAPSHOT</version>
                <executions>
                    <execution>
                        <id>generate-static-site</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>generate-static-site</goal>
                        </goals>
                        <configuration>
                            <inputDirectory>${project.basedir}/docs</inputDirectory>
                            <outputDirectory>${project.basedir}/site</outputDirectory>
                            <template>${project.basedir}/example-real-template.ftl</template>
                            <siteName>Your Site Name</siteName>
                            <strictLinkChecking>true</strictLinkChecking>
                            <extraConfig>
                                <version>1.2.3</version>
                            </extraConfig>
                         </configuration>
                     </execution>
                 </executions>
             </plugin>
...
        </plugins>
...
    </build>
...
<project>

Why not JBake, mkdocs, something else?

Most of the something-elses seem to focus on blogs rather than simple websites. Mkdocs worked fine for a while, but got slow with a hundreds of pages, and doesn't provide a a good hierarchical page representation to the template (for building a complete navigation menu). I looked briefly at JBake as an alternative, but was first annoyed by the compulsory metadata block, and then never got any reply on https://groups.google.com/forum/#!topic/jbake-user/nuDCRvAeGk4 (which, of course, did get a response 2 hours after writing that - though not a positive one).

No doubt someone will now point out the perfect existing system for what I want, or why building my own will be harder than I think (https://twitter.com/pinboard/status/761656824202276864) - Oh well.

Versions

Version
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1