this is a custom feature we need to define in config.toml
Add your social media in config.toml
You can add social media in HTML directly, also, can use config file which is easy to change every time you want to update.
|
|
Using in HTML page
Because header and footer both show social media, we just write a singe HTML, them import to some places you want to display.
|
|
Import to somewhere
In hugo, if you want to use global var, the synatx is $.Site.xxx. In this case is [$.Site.Params.social ];Range is the loop function.
Icon Source
In this project, I choose fontawesome as the icon source. You also can determine which icon library you want to use. Popular choices include Font Awesome, Material Icons, and Bootstrap Icons. You can either download the icon library and include it in your Hugo project or use a CDN link.