0.1.2 • Published 4 years ago

eleventy-navigation-bootstrap v0.1.2

Weekly downloads
1
License
MIT
Repository
gitlab
Last release
4 years ago

eleventy-navigation-bootstrap

Filter for the @11ty/eleventy-navigation plugin to support the bootstrap dropdown navigation.

Usage

Install via npm:

npm install --save-dev eleventy-navigation-bootstrap

Add this Nunjucks filter to your .eleventy.js file:

  const toBootstrapNav = require('eleventy-navigation-bootstrap')
  eleventyConfig.addNunjucksFilter('bootstrapNav', toBootstrapNav)

Pipe the @11ty/eleventy-navigation output to this filter like so:

{{ collections.all | eleventyNavigation | bootstrapNav | safe }}

Options

You can pass additional options:

{{ collections.all | eleventyNavigation | bootstrapNav({
    listClass: "nav nav-pills justify-content-center", listChildItemClass: "dropdown-menu shadow", activeKey: eleventyNavigation.key
  }) | safe }}

Available options are:

OptionTypeEffect
listElementstringHTML tag of the navigation list
listClassstringClass for the navigation list
listItemElementstringHTML tag for one navigation entry
listItemClassstringClass for one navigation entry
listItemLinkClassstringClass for the link of a navigation entry
listItemHasChildrenClassstringClass for a navigation entry that has child entries
listItemHasChildrenLinkClassstringClass for the link of a navigation entry that has child entries
listChildItemClassstringClass for a navigation entry that is child to another entry
listChildItemLinkClassstringClass for the link of a navigation entry that is child to another entry
activeKeystringCurrent page (provide this if you want to highlight the currently displayed page)
activeListItemClassstringClass of the navigation entry that corresponds to the current page
listDoorpageDividerstringDivider between the door page and the child entries of a parent page
0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago