eleventy-plugin-nav-menu
v0.0.1
Published
A responsive nav menu shortcode for Eleventy
Downloads
9
Maintainers
Readme
eleventy-plugin-nav-menu
⛵️ A responsive nav menu shortcode for Eleventy
Install
npm install eleventy-plugin-nav-menu
Usage
const navMenuPlugin = require('eleventy-plugin-nav-menu');
module.exports = function(eleventyConfig) {
eleventyConfig.addPlugin(navMenuPlugin)
return { /* ... */ }
}
The plugin adds three shortcodes:
navMenu
: A chunk of htmlnavMenuStyles
: Minimal (and minified) stylesnavMenuScript
: Minified JavaScript
Add them to your layout like so:
<!DOCTYPE html>
<head>
{% navMenuStyles %}
</head>
<body>
<!-- Use with @11ty/eleventy-navigation is optional -->
{% navMenu collections.all | eleventyNavigation %}
</body>
{% navMenuScript %}
</html>
Warning
This library is a work in progress. Expect changes before v1.0.0
release. Use at your own risk.
License
MIT © Sean McPherson