vantagedesign / ace-documentation

A free documentation theme for Hugo, powered by Bootstrap 4. Repsonsive, search, code highlighting and more.
https://docs.vantage-design.com/ace/
MIT License
103 stars 75 forks source link

Add option to show fontawesome icons in the menu #48

Closed dagerzuga closed 1 year ago

dagerzuga commented 1 year ago

Description

Adding the option to show fontawesome icons next to the links of the main menu. This works with a new parameter in the site's configuration.

This applies to main links and sub-links. Both links have the icon fa fa-arrow-right as the default one if nothing was specified in the .md file.

How to use this feature

Configuration

If you want to turn this on, you need to add this new parameter in the configuration file of your website (config.toml) and add true as its value.

[params]
enableIcons = true

Adding icons

Now you can specify the icon in the front-matter of your .md file.

+++
title = "Getting started"
description = ""
weight = 1
icon = "fas fa-fax"
+++

Note: You only need to add the name of the class, don't need to specify the HTML structure.

Turning off this feature

You can disable this feature by removing the enableIcons parameter from the configuration, or changing its value to false.

Images

Screen Shot 2022-11-10 at 18 00 51