App::unbelievable - Dancer2 static site generator
In your Dancer2 app:
use App::unbelievable; # Pulls in Dancer2 # your routes here unbelievable; # At EOF, fills in the rest of the routes.
Then:
$ unbelievable build # Make the HTML $ unbelievable serve # Run a local development server
App::unbelievable makes a Dancer2 application into a static site generator. App::unbelievable adds routes for / and /** that will render Markdown files in content/. The unbelievable script generates static HTML and other assets into _built/.
/
/**
content/
_built/
All non-hidden files in content/ are rendered as Markdown files. Hidden files are those that start with a . (the Unix convention).
.
Fenced code blocks are syntax-highlighted using Syntax::Highlight::Engine::Kate. Language names are the lowercased versions of the module suffixes in Syntax::Highlight::Engine::Kate::All.
In Markdown inputs, shortcode tags of the form:
{{< KEY [args] >}}
are replaced with the Dancer2 template shortcodes/KEY (e.g., views/shortcodes/foo.tt). Currently, only one argument is supported; it is passed to the template as variable _0.
shortcodes/KEY
views/shortcodes/foo.tt
_0
Use whatever you want in your routes! Use regular Dancer2 templating.
Everything in public/ is available under /, just as in Dancer2.
public/
Yet another site generator --- can you believe it? And now you know where the package name comes from ;) .
This package's roadmap is feature parity with Hugo.
My motivation for writing unbelievable was two-fold:
Perl.com is currently using Hugo, which is not written in Perl!
"every self-respecting programmer has written at least one static site generator ... since writing a basic one is easy and often tends to be easier than learning an existing one." --- SHLOMIF (here). :D
Imports Dancer2, among others, into the caller's namespace.
Make default routes to render Markdown files in content/ into HTML. Usage: unbelievable;. Returns a truthy value, so can be used as the last line in a module.
unbelievable;
Thanks to Getopt::Long::Subcommand --- I used some code from its Synopsis.
Thanks to App::Wallflower, Dancer2, and Syntax::Highlight::Engine::Kate for doing the heavy lifting!
Copyright (C) 2020 Chris White.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Chris White <cxwembedded@gmail.com>
To install App::unbelievable, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::unbelievable
CPAN shell
perl -MCPAN -e shell install App::unbelievable
For more information on module installation, please visit the detailed CPAN module installation guide.