assemble-middleware-navigation
v0.2.1
Published
Assemble navigation middleware. Automatically generate Bootstrap-style, multi-level side nav. See the sidenav on assemble.io for a demonstration.
Downloads
28
Readme
assemble-middleware-navigation
Assemble navigation middleware. Automatically generate Bootstrap-style, multi-level side nav. See the sidenav on assemble.io for a demonstration.
Upgrade notice!: as of v0.1.0, this middlweare requires Assemble v0.5.0.
Get the Assemble generator for Yeoman to kickstart new Assemble projects using this middleware.
Here's a preview
Quickstart
Install with npm:
npm i assemble-middleware-navigation --save-dev
Usage
Register the middleware with Assemble:
options: {
middleware: ['assemble-middleware-navigation', 'foo/*.js']
}
Visit the middleware docs for more info or for help getting started.
Add this markup where you want the navigation:
<div id="navigation">
<!-- navigation -->
</div>
The plugin uses page headings to construct the nav items, results in something like:
<div id="navigation">
<!-- navigation -->
<ul class="nav sidenav">
<li><a href="#collections">Collections</a>
<ul class="nav">
<li> <a href="#collections-after">{{after}}</a> </li>
<li> <a href="#collections-any">{{any}}</a> </li>
<li> <a href="#collections-before">{{before}}</a> </li>
</ul>
</li>
</ul>
</div>
Other Assemble middleware
Here are some related projects you might be interested in from the Assemble core team.
- assemble-middleware-anchors: Assemble middleware for creating anchor tags from generated html.
- assemble-middleware-contextual: Assemble middleware for generating a JSON file containing the context of each page. Basic middleware to help see what's happening in the build.
- assemble-middleware-decompress: Assemble plugin for extracting zip, tar and tar.gz archives.
- assemble-middleware-download: Assemble middleware for downloading files from GitHub.
- assemble-middleware-lunr: Assemble middleware for creating a search engine within your static site using lunr.js.
- assemble-middleware-permalinks: Permalinks middleware for Assemble, the static site generator for Grunt.js and Yeoman. This plugin enables powerful and configurable URI replacement patterns, presets, uses Moment.js for parsing dates, and much more.
- assemble-middleware-toc: Assemble middleware for creating a table of contents in the generated HTML, using Cheerio.js
- assemble-middleware-wordcount: Assemble middleware for displaying a word-count, and estimated reading time on blog posts or pages.
Visit assemble.io/assemble-middleware for more information about Assemble middleware.
Contributing
Find a bug? Have a feature request? Please create an Issue.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality,
and run docs
in the command line to build the docs with Verb.
Pull requests are also encouraged, and if you find this project useful please consider "starring" it to show your support! Thanks!
Authors
Jon Schlinkert
License
Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license
This file was generated by verb-cli on May 03, 2014.