MaiNav is a plugin that tries to figure out pages relations to each other and assigns each page it's parent page etc.. With that information(hopefully right) it can then generate navigation menus, bread crumbs, links to next and previous pages ans so on.
NB! - Be noted that this project is still in it's early phase.
Purpose: All your navigation needs in Jekyll!
The plugin seems fine for it's purpose, it did not work from scratch for me. I don't need the category stuff but I want to use a frontmatter possibility to exclude pages from the navigation
ekleinod fork
hide-nav
in frontmatter of pages
Probably the file name pattern is up for exclusion, because it seems to have no good usage over folder structure and level
attribute. It also ends up in final page's names and making a mechanism to exclude the level from final file path seems too much overhead for such a whiny little feature. The product of over thinking I guess.
Tag name catnav
needs to be changed to something in line of it's purpose. Candidates pagenav
.
Copy all .rb
files to your Jekyll site's _plugins
directory. If directory does not exist, create it.
I suggest you make a separate sub directory for all plugin's files. If you git clone
to _plugins
directory this is already taken care of.
Somehow just linking the directory into _plugins
does not work.
Level is the way MaiNav decides how the pages should be aligned and nested. Level can be defined by different ways: (In future that can be set in _config.yml - right now MaiNav checks for level attribute in front matter and falls back using page's path.)
level
attribute in pages front matter:
---
title: Animals
level: 1
---
Sub pages then should have the levels 1.1, 1.2 etc. Sub pages to level 1.1 should go 1.1.1, 1.1.2 and so on. Levels should be separated by dot by default. In future the level delimiter character can be set in _config.yml file.
You could also use words or letters as levels: animal, animal.dog, animal.cat. Be noted that level also decides the order of pages in navigation (so animal.cat comes before animal.dog).
(At current stage of the project - for debugging purposes this is set as the only option.)
animals/
animals/dog
animals/cat
Optionally pages in same directory can be ordered by setting the level attribute in page's front matter - this can be just 1, 2, 3, 4 etc.. Currently this is done by default.
ignore_level
option is set true level is used to align pages in specific order.(This tag's name is likely to be changed in the future.)
Example
{% catnav %}
Supported attributes:
class
attribute. Multiple classes can be specified by wrapping them into double quotes and separating with spaces.
{% catnav classes:"main-menu nav" %}
id
attribute.
{% catnav id:"nav-menu-1" %}
{% catnav categories:"flowers seeds" %}
If asterisk *
is used as categories value, then navigation is generated for all categories. Well suitable for main navigation usage.
{% catnav categories:* %}
{% catnav depth:2 %}
Generates a HTML list of pages leading to current page.
Example
{% breadcrumbs %}
Supported attributes:
class
attribute. Multiple classes can be specified by wrapping them into double quotes and separating with spaces.
{% breadcrumbs classes:"hansel gretel" %}
id
attribute.
{% breadcrumbs id:"hg1" %}
{% breadcrumbs home:"My site" %}
Currently yes. More stuff to be added soon.
The repository organization is based on the git branching model of http://nvie.com/posts/a-successful-git-branching-model/
develop
and master
(temporary)