Skip to content

Commit

Permalink
Standardize support for FA icons across the site
Browse files Browse the repository at this point in the history
  • Loading branch information
allejo committed Mar 22, 2020
1 parent 14d8603 commit 8055822
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 18 deletions.
5 changes: 5 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ license:
links:
header:
- title: GitHub
icon: github
brand: true
url: https://github.com/allejo/jekyll-docs-theme
homepage:
- title: View on GitHub
Expand All @@ -24,8 +26,11 @@ links:
url: https://github.com/allejo/jekyll-docs-theme
footer:
- title: GitHub
icon: github
brand: true
url: https://github.com/allejo/jekyll-docs-theme
- title: Issues
icon: bug
url: https://github.com/allejo/jekyll-docs-theme/issues?state=open

ui:
Expand Down
13 changes: 13 additions & 0 deletions _includes/fa-icon.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{% if include.icon %}
{% capture fa_prefix -%}
{%- if include.brand -%}
fab
{%- else -%}
fas
{%- endif -%}
{%- endcapture -%}
<i
class="{{ fa_prefix }} fa-{{ include.icon }} fa-fw {{ include.class }}"
aria-hidden="true"
></i>
{% endif %}
11 changes: 10 additions & 1 deletion _includes/footer/content.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,16 @@
<ul class="site-footer__links text-left list-inline mb-0">
{% for link in site.links.footer %}
<li class="list-inline-item">
<a href="{{ link.url }}">{{ link.title }}</a>
<a
href="{{ link.url }}"
class="site-footer__link"
>
{% include fa-icon.html
icon=link.icon
brand=link.brand
%}
<span>{{ link.title }}</span>
</a>
</li>
{% endfor %}
</ul>
Expand Down
19 changes: 5 additions & 14 deletions _includes/masthead/button.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,10 @@
href="{{ include.url }}"
class="site-masthead__button"
>
{% if include.icon %}
{% capture fa_prefix -%}
{%- if include.brand -%}
fab
{%- else -%}
fas
{%- endif -%}
{%- endcapture %}
<i
class="{{ fa_prefix }} fa-{{ include.icon }} fa-fw mr-1"
aria-hidden="true"
></i>
{% endif %}

{% include fa-icon.html
icon=include.icon
brand=include.brand
class="mr-1"
%}
{{ include.title }}
</a>
6 changes: 3 additions & 3 deletions _includes/masthead/buttons.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
{%- endcapture %}

{% include masthead/button.html
url=site.project.download_url
icon="download"
title=button_text
url=site.project.download_url
icon="download"
title=button_text
%}
{% endif %}

Expand Down
1 change: 1 addition & 0 deletions _includes/navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
class="nav-link"
href="{{ p.url }}"
>
{% include fa-icon.html icon=p.icon brand=p.brand %}
{{ p.title }}
</a>
</li>
Expand Down

0 comments on commit 8055822

Please sign in to comment.