sidebar.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. {% if DISPLAY_TAGS_ON_SIDEBAR is not defined %}
  2. {% set DISPLAY_TAGS_ON_SIDEBAR = True %}
  3. {% endif %}
  4. <section class="well well-sm">
  5. <ul class="list-group list-group-flush">
  6. {% if SOCIAL %}
  7. <li class="list-group-item"><h4><i class="fa fa-home fa-lg"></i><span class="icon-label">Social</span></h4>
  8. <ul class="list-group" id="social">
  9. {% for s in SOCIAL %}
  10. {% if s[2] %}
  11. {% set name_sanitized = s[2]|lower|replace('+','-plus')|replace(' ','-') %}
  12. {% else %}
  13. {% set name_sanitized = s[0]|lower|replace('+','-plus')|replace(' ','-') %}
  14. {% endif %}
  15. {% if name_sanitized in ['flickr', 'spotify', 'stack-overflow', 'weibo'] %}
  16. {% set iconattributes = '"fa fa-' ~ name_sanitized ~ ' fa-lg"' %}
  17. {% else %}
  18. {% set iconattributes = '"fa fa-' ~ name_sanitized ~ '-square fa-lg"' %}
  19. {% endif %}
  20. <li class="list-group-item"><a href="{{ s[1] }}"><i class={{ iconattributes }}></i> {{ s[0] }}</a></li>
  21. {% endfor %}
  22. </ul>
  23. </li>
  24. {% endif %}
  25. {% if DISPLAY_RECENT_POSTS_ON_SIDEBAR %}
  26. {% if RECENT_POST_COUNT is not defined %}
  27. {% set RECENT_POST_COUNT = 5 %}
  28. {% endif %}
  29. <li class="list-group-item"><h4><i class="fa fa-home fa-lg"></i><span class="icon-label">Recent Posts</span></h4>
  30. <ul class="list-group" id="recentposts">
  31. {% for article in articles[:RECENT_POST_COUNT] %}
  32. <li class="list-group-item">
  33. <a href="{{ SITEURL }}/{{ article.url }}">
  34. {{ article.title }}
  35. </a>
  36. </li>
  37. {% endfor %}
  38. </ul>
  39. </li>
  40. {% endif %}
  41. {% if DISPLAY_CATEGORIES_ON_SIDEBAR %}
  42. <li class="list-group-item"><a href="{{ SITEURL }}/{{ CATEGORIES_URL }}"><h4><i class="fa fa-home fa-lg"></i><span class="icon-label">Categories</span></h4></a>
  43. <ul class="list-group" id="categories">
  44. {% for cat, null in categories %}
  45. <li class="list-group-item">
  46. <a href="{{ SITEURL }}/{{ cat.url }}">
  47. <i class="fa fa-folder-open fa-lg"></i> {{ cat }}
  48. </a>
  49. </li>
  50. {% endfor %}
  51. </ul>
  52. </li>
  53. {% endif %}
  54. {% if 'tag_cloud' in PLUGINS and DISPLAY_TAGS_ON_SIDEBAR %}
  55. {% if DISPLAY_TAGS_INLINE %}
  56. {% set tags = tag_cloud | sort(attribute='0') %}
  57. {% else %}
  58. {% set tags = tag_cloud | sort(attribute='1') %}
  59. {% endif %}
  60. <li class="list-group-item"><a href="{{ SITEURL }}/{{ TAGS_URL }}"><h4><i class="fa fa-tags fa-lg"></i><span class="icon-label">Tags</span></h4></a>
  61. <ul class="list-group {% if DISPLAY_TAGS_INLINE %}list-inline tagcloud{% endif %}" id="tags">
  62. {% for tag in tags %}
  63. <li class="list-group-item tag-{{ tag.1 }}">
  64. <a href="{{ SITEURL }}/{{ tag.0.url }}">
  65. {{ tag.0 }}
  66. </a>
  67. </li>
  68. {% endfor %}
  69. </ul>
  70. </li>
  71. {% endif %}
  72. {% if DISPLAY_SERIES_ON_SIDEBAR %}
  73. {% if article %}
  74. {% if article.series %}
  75. <li class="list-group-item"><h4><i class="fa fa-tags fa-list-ul"></i><span class="icon-label">Series</span></h4>
  76. <ul class="list-group">
  77. <li class="list-group-item">
  78. {% if article.series.previous %}
  79. <h5></i> Previous article</h5>
  80. <a href="{{ SITEURL }}/{{ article.series.previous.url }}">{{ article.series.previous.title }}</a>
  81. {% endif %}
  82. </li>
  83. <li class="list-group-item">
  84. {% if article.series.next %}
  85. <h5>Next article</h5>
  86. <a href="{{ SITEURL }}/{{ article.series.next.url }}">{{ article.series.next.title }}</a>
  87. {% endif %}
  88. </li>
  89. </ul>
  90. </li>
  91. {% endif%}
  92. {% endif %}
  93. {% endif %}
  94. {% include 'includes/github.html' %}
  95. {% include 'includes/twitter_timeline.html' %}
  96. {% include 'includes/links.html' %}
  97. {% include 'includes/sidebar-images.html' %}
  98. </ul>
  99. </section>