Yancy::Backend::Static - Build a Yancy site from static Markdown files
version 0.003
use Mojolicious::Lite; plugin Yancy => { backend => 'static:/home/doug/www/preaction.me', read_schema => 1, }; get '/*id', controller => 'yancy', action => 'get', collection => 'page', id => 'index', # Default to index page template => 'page', ; app->start; __DATA__ @@ page.html.ep <%== $item->{html} %>
This Yancy::Backend allows Yancy to work with a site made up of Markdown files with YAML frontmatter, like a Statocles site. In other words, this module works with a flat-file database made up of YAML + Markdown files.
You should configure the pages collection to have all of the fields that could be in the frontmatter of your Markdown files. This is JSON Schema and will be validated, but if you're using the Yancy editor, make sure only to use the types Yancy supports.
pages
This backend should support everything Yancy::Backend supports, though some list() queries may not work (please make a pull request).
This backend could be enhanced to provide collections for static files (CSS, JavaScript, etc...) and templates.
Yancy, Statocles
Doug Bell <preaction@cpan.org>
Mohammad S Anwar <mohammad.anwar@yahoo.com>
This software is copyright (c) 2019 by Doug Bell.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Yancy::Backend::Static, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Yancy::Backend::Static
CPAN shell
perl -MCPAN -e shell install Yancy::Backend::Static
For more information on module installation, please visit the detailed CPAN module installation guide.