Skip to content

manwar/Yancy-Backend-Static

 
 

Repository files navigation

Build Status Coverage Status

NAME

Yancy::Backend::Static - Build a Yancy site from static Markdown files

VERSION

version 0.009

SYNOPSIS

use Mojolicious::Lite;
plugin Yancy => {
    backend => 'static:/home/doug/www/preaction.me',
    read_schema => 1,
};
get '/*id',
    controller => 'yancy',
    action => 'get',
    schema => 'page',
    id => 'index', # Default to index page
    template => 'page',
    ;
app->start;
__DATA__
@@ page.html.ep
<%== $item->{html} %>

DESCRIPTION

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.

Schemas

You should configure the pages schema 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.

Limitations

This backend should support everything Yancy::Backend supports, though some list() queries may not work (please make a pull request).

Future Developments

This backend could be enhanced to provide schema for static files (CSS, JavaScript, etc...) and templates.

SEE ALSO

Yancy, Statocles

AUTHOR

Doug Bell preaction@cpan.org

CONTRIBUTORS

COPYRIGHT AND LICENSE

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.

About

A static site backend for the Yancy CMS

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Perl 99.9%
  • CSS 0.1%