social_links.html 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. {% if SOCIAL %}
  2. {% from '_includes/_defaults.html' import SOCIAL_PROFILE_LABEL with context %}
  3. <h4>{{ SOCIAL_PROFILE_LABEL }}</h4>
  4. {% for entry in SOCIAL %}
  5. {% set f_entry = [] %}
  6. {%for item in entry %}
  7. {# first is for name #}
  8. {% if loop.first %}
  9. {% set link_title = 'My ' + item + ' Profile' %}
  10. {% set link_icon = item.lower() %}
  11. {% if item.lower() == 'email' %}
  12. {% set link_title = 'My ' + item + ' Address' %}
  13. {% set link_icon = 'envelope' %}
  14. {% elif item.lower() == 'rss' %}
  15. {% set link_title = 'Subscribe in a reader' %}
  16. {% set link_icon = 'rss' %}
  17. {% endif %}
  18. {% if f_entry.insert(0, link_title) %}{% endif %}
  19. {% if f_entry.insert(1, link_icon) %}{% endif %}
  20. {% elif loop.index0 == 1 %}
  21. {% set url = item|e %}
  22. {% if f_entry.insert(2, url) %}{% endif %}
  23. {% elif loop.index0 == 2 %}
  24. {% set link_icon = item.lower() %}
  25. {% if f_entry.pop(1) %}{% endif %}
  26. {% if f_entry.insert(1, link_icon) %}{% endif %}
  27. {% endif %}
  28. {% endfor %}
  29. <a href="{{f_entry[2]}}" title="{{f_entry[0]}}" class="sidebar-social-links" target="_blank">
  30. <i class="fa fa-{{f_entry[1]}} sidebar-social-links"></i></a>
  31. {% endfor %}
  32. {% endif %}