diff --git a/README.md b/README.md index 5619856..dddbdc0 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,10 @@ Visit the [Settings docs](docs/settings.md) for examples: - **SITEIMAGE**: Image that appears in the header. - **DESCRIPTION**: Index HTML head `` description. - **LINKS**: A list of tuples (Title, URL) for menu links. -- **ICONS**: A list of tuples (Icon, URL) for icon links. +- **ICONS**: A list of tuples (Icon, URL) for icon links. Icons are assumed to + be Font Awesome brand icons, if you need to use icons from other Font + Awesome icon set please provide full [CSS class], e.g. `fas fa-camera` + instead on just `camera` - **FOOTER_LINKS**: A list of tuples (Title, URL) for footer links. Replaces default set of links (Authors, Archives, Categories, Tags). - **BOOTSTRAP_CSS**: URL of Bootstrap CSS file. Use this to enable Boostwatch themes. @@ -129,6 +132,8 @@ Visit the [Settings docs](docs/settings.md) for examples: theme. Alchemy uses no JS by default. Both relative and absolute URLs are supported. +[CSS class]: https://fontawesome.com/how-to-use/on-the-web/referencing-icons/basic-use + Misc settings: - **DISQUS_SITENAME** diff --git a/alchemy/templates/include/header.html b/alchemy/templates/include/header.html index 94709dd..517c0ff 100644 --- a/alchemy/templates/include/header.html +++ b/alchemy/templates/include/header.html @@ -1,3 +1,16 @@ +{%- macro fa(icon) -%} +{%- set fa_special_icons = { + "feed": "fas fa-rss", + "rss": "fas fa-rss", +} -%} +{%- if icon in fa_special_icons -%} +{{ fa_special_icons[icon] }} +{%- elif icon.startswith("fa") -%} +{{ icon }} +{%- else -%} +fab fa-{{icon}} +{%- endif -%} +{%- endmacro -%}