Hello, I am having difficulties producing a menu to my liking (out-of-the-box), and I''m wondering if I discovered a bug... Consider a directory structure like this: default.template index.page about/index.page video/index.page contact/index.page where default.template has the tag {menu: } The only pages/directories I want *excluded* from this menu are video/ and video/index.page, so I set my "in_menu" entries accordingly. The problem is that video/index.page is not excluded from the menu, even if "in_menu: false" is set. I experimented with this for a bit, and I discovered that by removing all headers (h1, h2, etc.) from video/index.page, video/ and video/index.page *are* excluded from the menu, which is what I want. In other words, it seems that whenever a header has an "id" attribute, its containing page doesn''t honor the "in_menu" setting. Is this a bug, or is there a solution that I overlooked? Thanks, Patrick P.S. As a workaround for now, I am adding the following line to my config.yaml: contentprocessor.kramdown.options: {:auto_ids: false} And then I can add custom classes (instead of id''s) to use for styling.
On 2010-09-29 15:24 -0700 Patrick McCarty wrote:> The only pages/directories I want *excluded* from this menu are video/ > and video/index.page, so I set my "in_menu" entries accordingly. > > The problem is that video/index.page is not excluded from the menu, > even if "in_menu: false" is set. > > I experimented with this for a bit, and I discovered that by removing > all headers (h1, h2, etc.) from video/index.page, video/ and > video/index.page *are* excluded from the menu, which is what I want. > > In other words, it seems that whenever a header has an "id" attribute, > its containing page doesn''t honor the "in_menu" setting. > > Is this a bug, or is there a solution that I overlooked?You need to look into the default.template where the menu is defined and set the key-value pair `used_nodes: files`. If this key is not set or set to `all`, then all nodes, even fragment nodes generated from headers with IDs, are used in a menu! Also see http://webgen.rubyforge.org/documentation/reference_configuration.html#tagmenuusednodes -- Thomas
On 2010-09-30, Thomas Leitner wrote:> On 2010-09-29 15:24 -0700 Patrick McCarty wrote: > > > > In other words, it seems that whenever a header has an "id" attribute, > > its containing page doesn''t honor the "in_menu" setting. > > > > Is this a bug, or is there a solution that I overlooked? > > You need to look into the default.template where the menu is defined > and set the key-value pair `used_nodes: files`. If this key is not set > or set to `all`, then all nodes, even fragment nodes generated from > headers with IDs, are used in a menu! > > Also see > http://webgen.rubyforge.org/documentation/reference_configuration.html#tagmenuusednodesThat is exactly what I was looking for. Thanks! -Patrick