/ /cmd /cmd.plated /cmd.plated.build /cmd.plated.watch/html /html.plated /html.plated.chunks /html.plated.files /html.plated.macros /html.plated.operators/html.plated_plugin /html.plated_plugin.blog /html.plated_plugin.copy /html.plated_plugin.docs /html.plated_plugin.import /html.plated_plugin.redirect/js /js.plated /js.plated.blog /js.plated.build /js.plated.micro /js.plated.plugin /js.plated.setup /js.plated.watch/js.plated_chunks /js.plated_chunks.deepmerge /js.plated_chunks.delimiter_close_str /js.plated_chunks.delimiter_open_str /js.plated_chunks.delimiter_wrap_str /js.plated_chunks.expand_tag /js.plated_chunks.fill_chunks /js.plated_chunks.format_chunks /js.plated_chunks.lookup /js.plated_chunks.lookup_in_namespace /js.plated_chunks.markdown /js.plated_chunks.merge_namespace /js.plated_chunks.pop_namespace /js.plated_chunks.prepare /js.plated_chunks.push_namespace /js.plated_chunks.remove_underscorechunks /js.plated_chunks.replace /js.plated_chunks.replace_once /js.plated_chunks.reset_namespace /js.plated_chunks.set_namespace/js.plated_files /js.plated_files.base_files_to_chunks /js.plated_files.build /js.plated_files.build_file /js.plated_files.empty_cache /js.plated_files.empty_folder /js.plated_files.exists /js.plated_files.file_to_chunks /js.plated_files.filename_fixup /js.plated_files.filename_is_basechunk /js.plated_files.filename_is_plated /js.plated_files.filename_to_dirname /js.plated_files.filename_to_output /js.plated_files.find_dirs /js.plated_files.find_files /js.plated_files.joinpath /js.plated_files.lstat /js.plated_files.mkdir /js.plated_files.prepare_namespace /js.plated_files.readdir /js.plated_files.set_source /js.plated_files.source_to_output /js.plated_files.stat /js.plated_files.trimpath /js.plated_files.watch /js.plated_files.write/js.plated_output /js.plated_output.remember /js.plated_output.remember_and_write /js.plated_output.write /js.plated_output.write_all /js.plated_output.write_map/js.plated_plugin /js.plated_plugin.blog /js.plated_plugin.blog.process_dirs /js.plated_plugin.blog.process_file/js.plated_plugin.copy /js.plated_plugin.copy.process_dirs /js.plated_plugin.copy.process_file /js.plated_plugin.copy.process_output/js.plated_plugin.docs /js.plated_plugin.docs.process_dirs /js.plated_plugin.docs.process_file/js.plated_plugin.import /js.plated_plugin.import.process_file/js.plated_plugin.redirect /js.plated_plugin.redirect.process_dirs /js.plated_plugin.redirect.process_file

html.plated_plugin.blog

#^_blog_json
{
    posts_per_page:5,
    posts_per_feed:20,
    url:"http://base.site/url/",
    feed:{
        title:"Feed Title",
    }
}

A chunk of this name must be created in a directory scope file for this plugin to parse it. posts_per_page is the number of posts per page, we will create as many pages as we need.

posts_per_feed specifys the number of posts to publish in the feed.json file. Which will be published using any data suplied in feed which can contain any valid jsonfeed values. The base url must also be suplied since feeds are expected to be copied to other domains. This url is intentionally seperate from _root as it must be explictly set and we can not get away with relative paths here.

Every directory within this blog directory will now be treated as a blogpost.

See source/blog for an example of this all fits together. Inside each of these directories we look for.

#^_blog_post_json
{
    "title":"my title",
    "author":"my name",
    tags:["tag1","tag2"],
    feed:{
        attachments:[{url:"http://domain.full/thing.mp3",mime_type:"mime/type"}],
    }
}

Which contains metadata about the blog post, the feed object can contain any valid jsonfeed settings, by we try and set useful defaults from the rest of the metadata. All of these values can also be used in your templates to render the blog posts.

#^_blog_post_body form=markdown
This is my blog post body.

Our blog body is to be found in this chunk name, probably best to use markdown as it makes writing blog posts easier.

When it comes to generating the pages then the following chunks should be setup in base directory.

#^_blog_page_body
This is a page of blog posts, eg the front page.

Within this chunk we provide _blog_page_older as the url of an older page and _blog_page_newer as the url of a newer page. If there is no newer or older page then this will be empty. _list will contain an array of blog posts that we intend to display in this page. It will be at least one post and no more than the posts_per_page setting.

#^_blog_post_body
This is a single blog post, when viewed on its own page.

Within this chunk we provide _blog_post_older as the url of an older page and _blog_post_newer as the url of a newer page. If there is no newer or older page then this will be empty. _blog_post_body will contain the _blog_post_body as defined in the blog post directory.

html.plated_plugin.copy

#^_copy_json
{
    include:[
        "",
    ],
    exclude:[
        "fra",
        "spa",
    ],
}

A chunk of this name must be created in a directory scope file for this plugin to parse it. include is a list of prefixes to include and exclude is a list of prefixes within the include to exclude.

The above configuration is assumed to be within a file fra/^.index and spa/^.index so it would include all chunkfiles from root but exclude files in fra or spa, ie itself. This way we can have a default english site and a spanish translation under spa/ or french under fra/

The files are copied into the current directory without the prefix used in include.

An example can be found in test-source/006-copy

html.plated_plugin.docs

#^_docs_json
{
    ignore:{
        "node_modules":true,
    },
    dirs:{
        "../js":".js",
    },
}

A chunk of this name must be created in a directory scope file for this plugin to parse it. We should ignore any paths containing the key strings in the ignore object and will include (recursively) the keys in the dirs object but only if the filename ends in the given string.

So in the above case we will scan ../js for all .js files but ignore everything in node_modules. One should always ignore everything in node_modules.

These files are searched for special auto doc documentation syntax where any line that begins with --[#name.of.the.chunk will begin a special documentation chunk and ]] will end it. In both cases the string must be at the start of a line.

Each of these chunks will then be rendered into its own page as well as its parent pages, we use dot notation to describe this relationship. In the case of name.of.the.chunk it will exist in name.of.the name.of name and the always present /

Take a look at the source code that generates this site documentation in source/docs for an example of how this can be themed and presented.

html.plated_plugin.import

#^importedchunk import=dir/dir
...

The content if this chunk is unimportant as it will be replaced by the chunk referenced from another file via the import=dir flag.

html.plated_plugin.redirect

#^_redirect_json
{
    files:{
        "from/index.html":"to/",
        "other/index.html":"to/",
    },
}

A chunk of this name must be created in a directory scope file for this plugin to parse it. files is a map of redirections we require.

Perform a redirect of files, using simple html javascript redirection, to another url. We mostly make use of the automatic use of an index.html inside a given directory so in the case above ./from will get redirected to ./to note that these can contain one level of macro expansion so {_root}dir is a reasonable redirection.

Multiple redirections can be performed in a single json configuration but be aware that we end up actually creating files to perform these redirections so be careful not to clash with other files.

An example can be found in test-source/005-redirect