This is a plugin for Section, a static site generator, that builds paths and URLs while also extracting dates and indexes from filenames.
This plugin requires the
~0.1.0 version of the grunt-section plugin.
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. You may install this plugin with this command:
npm install section-router --save
This plugin introduces a number of new options that can be set on the grunt-section configuration object inside the
Gruntfile.js file. Here’s a simple example of how that file might look like:
An array of extensions dictating what files should be treated as content files. Content files are text files that have their bodies loaded into memory for transformation purposes and are later written to disk as
Usually this is the root of your website, and will be used to determine the URL of each page/resource.
By default, for a file named something like
2013-09-25-name.md the plugin extracts the date and removes it from the filename.
The index of a file determines its position in listings such as menus. By default the plugin looks for files like
01-name.md. In this specific case the file will have the
01- removed and will take the first position in listings.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.