Menu definitions: the pre attribute?


Menu definitions

need a pre attribute which has to be supplied in the config.toml file.


What does pre mean and what do I need to supply as the value?


This seems to be relevant to the theme you chose to use.

The required pre tag (preformatted text element) has to do with how that theme renders the menu.

1 Like

What Hugo does it that the value which is given for pre is copied as is. But no pre tag. What is not clear why the theme wants that and what it is for

<i class='fa fa-user fa-fw'>

The possible values for the blackburn theme are

pre = "<i class='fa fa-home fa-fw'></i>"
pre = "<i class='fa fa-list fa-fw'></i>"
pre = "<i class='fa fa-user fa-fw'></i>"
pre = "<i class='fa fa-phone fa-fw'></i>"

So this looks like a trick to assign specific CSS classes to a menu item. However I would have expected for classes


to be assigned generally.

On a more general level the question is:

Which themes are recommended as good and well written examples to learn from?

In another thread the following theme was recommended

I wonder if there are more noteworthey examples which show how menus are to be constructed.

These could be linked to from

Check out Hugo’s Twitter feed. @bep has been porting themes to Hugo lately.

Thank you

Here they are