getpelican / pelican-themes

Themes for Pelican
https://getpelican.com/
2.12k stars 1.09k forks source link

bootstrap3: the docker fontawesome icon doesn't show up #679

Closed scretu closed 2 years ago

scretu commented 4 years ago

Hi guys, By using this configuration (tried with and without 'docker' as a third argument on the 'dockerhub' line), the 'docker' icon doesn't show up:

extract from pelicanconf

('linkedin', 'https://www.linkedin.com/in/silviancretu/'), ('github', 'https://github.com/scretu'), ('bitbucket', 'https://bitbucket.org/scretu/'), ('dockerhub', 'https://hub.docker.com/u/scretu', 'docker'), ('slideshare', 'https://www.slideshare.net/SilvianCretu'),

screenshot showing the icon missing: Screenshot_20200425_084140

scretu commented 4 years ago

I manage to track this to the fact that 'fa-docker' doesn't exist in FontAwesome 4.7.0 which is used by pelican-bootstrap3. So I created a FontAwesome account for myself and integrated a FontAwesome 5 in the theme, for my website. Like this:

$ git diff
diff --git a/themes/pelican-bootstrap3/templates/includes/sidebar/social.html b/themes/pelican-bootstrap3/templates/includes/sidebar/social.html
index a4bdc91..94452d6 100644
--- a/themes/pelican-bootstrap3/templates/includes/sidebar/social.html
+++ b/themes/pelican-bootstrap3/templates/includes/sidebar/social.html
@@ -1,6 +1,8 @@
 {% if SOCIAL %}
   {% from 'includes/sidebar/macros.jinja' import title %}
-
+  <head>
+    <script src="https://kit.fontawesome.com/kit-id.js" crossorigin="anonymous"></script>
+  </head>
 <!-- Sidebar/Social -->
 <li class="list-group-item">
   <h4>{{ title(_('Social'), DISABLE_SIDEBAR_TITLE_ICONS) }}</h4>
@@ -13,6 +15,8 @@
       {% endif %}
       {% if name_sanitized in ['flickr', 'slideshare', 'instagram', 'spotify', 'stack-overflow', 'weibo', 'line-chart', 'home', 'user', 'users', 'envelope', 'envelope-o', 'stack-exchange', 'hacker-news', 'gitlab', 'vk'] %}
         {% set iconattributes = '"fa fa-' ~ name_sanitized ~ ' fa-lg"' %}
+      {% elif name_sanitized in ['docker'] %}
+        {% set iconattributes = '"fab fa-' ~ name_sanitized ~ '"' %}
       {% else %}
         {% set iconattributes = '"fa fa-' ~ name_sanitized ~ '-square fa-lg"' %}
       {% endif %}

where kit-id is, of course, my FontAwesome 5 kit it.