docpad-plugin-menu
docpad-plugin-menu copied to clipboard
No way to include root index.html document to the menu and keep "optimize: true"-behavior
If optimize
option set to true
then there is no root index.html document in generated menu structure. But what if I need to include it?
The idea of optimize
option is to remove index.html
for you. I don’t quite understand what you’re trying to do.
I want to include root document (with url of "/") to the menu. When index.html removed - there is no root document in the generated menu. I.e. if we have a site example.com with subfolders dir1 and dir2 which contains some documents, then generated menu will contains example.com/dir1 and example.com/dir2, but not root document - example.com.
There are number of ways you can do it: explicitly add root item in your templates, create custom function in DocPad config which will extend menu structure, generated by generateMenu
method etc.
Yep but in those cases I will need to handle "current" state of this item by myself, it will not be really handled by the plugin. Not a big issue really, I just wanted to find some way to include this root item in the set which handled by plugin so everything will just happens automatically...
+1 would be nice to have this!
another plus one, id love to not be statically hardcoding my / note into the html of the menu.