Jekyll - Setup Font Awesome Icons
The icons from Font Awesome are great to use within a website.
Now that I have my digital garden set up as a static website via Jekyll I wanted to use these icons.
Setup with an external source
Through Stackoverflow I found out that it can be very simple to use the icons of Font Awesome. Namely by adding the following stylesheet to the header (for Jekyll this is often _includes/head.html
):
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
You can then display an icon as follows:
<i class='fa fa-home'></i>
Setup with your own hosting
However, I wanted to host the stylesheet myself and not load it from an external source. That also turned out to be very simple.
- Download the
Free for Web
zip file from this page - From the zip file, copy the stylesheet
css/all.min.css
to theassets/css
folder you are using as the source for Jekyll. I also renamed the stylesheet tofontawesome.all.min.css
- Copy from the zip file the contents of the folder
webfonts
to theassets/webfonts
folder that you use as source for Jekyll - Now add to the header (for Jekyll this is often
_includes/head.html
):
<link href="/assets/css/fontawesome.all.min.css" rel="stylesheet">
And then you can display the icon again as follows:
<i class='fa fa-home'></i>
Read other notes
Tags
Notes mentioning this note
- Jekyll - Setup Markdown Note Tags
I use Obsidian to make markdown notes. I put the tags in the front matter. On this Jekyll website (my...
Comments
No comments found for this note.
Join the discussion for this note on this ticket. Comments appear on this page instantly.