docpad-plugin-menu icon indicating copy to clipboard operation
docpad-plugin-menu copied to clipboard

No way to include root index.html document to the menu and keep "optimize: true"-behavior

Open andreyvolokitin opened this issue 10 years ago • 6 comments

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?

andreyvolokitin avatar Sep 29 '13 10:09 andreyvolokitin

The idea of optimize option is to remove index.html for you. I don’t quite understand what you’re trying to do.

sergeche avatar Sep 29 '13 10:09 sergeche

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.

andreyvolokitin avatar Sep 29 '13 11:09 andreyvolokitin

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.

sergeche avatar Sep 29 '13 11:09 sergeche

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...

andreyvolokitin avatar Sep 29 '13 11:09 andreyvolokitin

+1 would be nice to have this!

Jehu avatar Apr 22 '14 09:04 Jehu

another plus one, id love to not be statically hardcoding my / note into the html of the menu.

techdragon avatar May 04 '14 18:05 techdragon