Skip to content

Icons in the menus #457

@narrenfrei

Description

@narrenfrei

I'm working on some updates improvements around our menus. #342 #449 #450
In #342 was asked about adding icons to the menu items. So I took a look, if there already exists a official possibility in Hugo and/or Docsy.

In the examples of the Hugo docs (https://gohugo.io/content-management/menus/#add-non-content-entries-to-a-menu) they are using the parameter pre of the menu entries for adding icons. But in Docsy the parameter pre (and post) is not supported.

My suggestion:

  • Add support for pre and post for menu entries threw config.toml, to support this "official" feature in the hugo docs.
  • Introduce in Docsy a new meta data (front matter) term (maybe called icon) to define an icon at page level directly in the content files. In this parameter a icon could get defined by the common Font Awsome classes (eg. "fa fa-road").
    • This new parameter ´icon` could get used to show icons in the side bar tree menu.
    • And I would also make a possibility to set icons to the main menu also in this way (with the common Font Awsome classes). Because the HTML markup (and default formatting in CSS) is better definable, when only the classes are allowed than a injection of any code threw pre/post parameter.

This approach would also solve #444

Any comments?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions