n/rss+xml',
atom => 'application/atom+xml',
js => 'application/javascript',
json => 'application/json',
);
has type => (
is => 'ro',
isa => Str,
lazy => 1,
default => sub
ault store
reads documents in YAML and writes pages to a file, but stores could read
documents as JSON, or from a Mongo database, and write pages to a database, or
wherever you want!
=over 4
=item L
ity functions to reduce dependencies
use Statocles::Base;
use Exporter 'import';
use Mojo::JSON qw( to_json );
our @EXPORT_OK = qw(
trim dircopy run_editor uniq_by derp read_stdin
);
#pod =sub
set of arguments.
#pod
#pod =cut
our %DERPED;
sub derp(@) {
my @args = @_;
my $key = to_json \@args;
return if $DERPED{ $key };
if ( $args[0] !~ /\.$/ ) {
$args[0] .= '.';
atocles::Role::PageAttrs';
use Statocles::Image;
use Statocles::Util qw( derp );
use YAML ();
use JSON::PP;
#pod =attr path
#pod
#pod The path to this document. This is not settable from the frontmat
ment> object.
#pod
#pod This parses the YAML or JSON frontmatter into the document's attributes,
#pod putting the rest of the file after the YAML or JSON frontmatter in the
#pod C<content> attribute.
}
# JSON frontmatter
elsif ( @lines && $lines[0] =~ /^{/ ) {
my $json;
if ( $lines[0] =~ /\}$/ ) {
# The JSON is all on a single line
$json = shift @