mirror of
https://github.com/nairobilug/pelican-alchemy.git
synced 2024-12-30 12:15:06 +01:00
Add workaround for icons backwards compatibility
Now old pelicanconf.py should be rendered correctly with new Font Awesome: - Some special cases are hardcoded. For now those are 'rss' and 'feed' - If icon string starts with 'fa' it is assumed to represent full CSS class - Otherwise a brand icon is assumed - sensible fallback for most users
This commit is contained in:
parent
2521b87383
commit
046f2fdd72
2 changed files with 20 additions and 2 deletions
|
|
@ -116,7 +116,10 @@ Visit the [Settings docs](docs/settings.md) for examples:
|
||||||
- **SITEIMAGE**: Image that appears in the header.
|
- **SITEIMAGE**: Image that appears in the header.
|
||||||
- **DESCRIPTION**: Index HTML head `<meta>` description.
|
- **DESCRIPTION**: Index HTML head `<meta>` description.
|
||||||
- **LINKS**: A list of tuples (Title, URL) for menu links.
|
- **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
|
- **FOOTER_LINKS**: A list of tuples (Title, URL) for footer links. Replaces
|
||||||
default set of links (Authors, Archives, Categories, Tags).
|
default set of links (Authors, Archives, Categories, Tags).
|
||||||
- **BOOTSTRAP_CSS**: URL of Bootstrap CSS file. Use this to enable Boostwatch themes.
|
- **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
|
theme. Alchemy uses no JS by default. Both relative and absolute URLs are
|
||||||
supported.
|
supported.
|
||||||
|
|
||||||
|
[CSS class]: https://fontawesome.com/how-to-use/on-the-web/referencing-icons/basic-use
|
||||||
|
|
||||||
Misc settings:
|
Misc settings:
|
||||||
|
|
||||||
- **DISQUS_SITENAME**
|
- **DISQUS_SITENAME**
|
||||||
|
|
|
||||||
|
|
@ -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 -%}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{% if SITEIMAGE %}
|
{% if SITEIMAGE %}
|
||||||
<div class="col-sm-4">
|
<div class="col-sm-4">
|
||||||
|
|
@ -28,7 +41,7 @@
|
||||||
{% if (LINKS or (DISPLAY_PAGES_ON_MENU and pages)) and loop.first %}
|
{% if (LINKS or (DISPLAY_PAGES_ON_MENU and pages)) and loop.first %}
|
||||||
<li class=" list-inline-item text-muted">|</li>
|
<li class=" list-inline-item text-muted">|</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<li class="list-inline-item"><a class="{{ icon }}" href="{{ url(link) }}" target="_blank"></a></li>
|
<li class="list-inline-item"><a class="{{ fa(icon) }}" href="{{ url(link) }}" target="_blank"></a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue