sidebar.html.twig 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. {% set feed_url = blog.url == '/' or blog.url == base_url_relative ? (base_url_relative~'/'~blog.slug) : blog.url %}
  2. {% set new_base_url = blog.url == '/' ? '' : blog.url %}
  3. {% if config.plugins.simplesearch.enabled %}
  4. <div class="sidebar-content">
  5. <h4>SimpleSearch</h4>
  6. {% include 'partials/simplesearch_searchbox.html.twig' %}
  7. </div>
  8. {% endif %}
  9. {% if config.plugins.relatedpages.enabled and related_pages|length > 0 %}
  10. <h4>Related Posts</h4>
  11. {% include 'partials/relatedpages.html.twig' %}
  12. {% endif %}
  13. {% if config.plugins.random.enabled %}
  14. <div class="sidebar-content">
  15. <h4>Random Article</h4>
  16. <a class="button" href="{{ base_url }}/random"><i class="fa fa-retweet"></i> I'm Feeling Lucky!</a>
  17. </div>
  18. {% endif %}
  19. <div class="sidebar-content">
  20. <h4>Some Text Widget</h4>
  21. <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna.</p>
  22. </div>
  23. {% if config.plugins.taxonomylist.enabled %}
  24. <div class="sidebar-content">
  25. <h4>Popular Tags</h4>
  26. {% include 'partials/taxonomylist.html.twig' with {'base_url':new_base_url, 'taxonomy':'tag'} %}
  27. </div>
  28. {% endif %}
  29. {% if config.plugins.archives.enabled %}
  30. <div class="sidebar-content">
  31. <h4>Archives</h4>
  32. {% include 'partials/archives.html.twig' with {'base_url':new_base_url} %}
  33. </div>
  34. {% endif %}
  35. {% if config.plugins.feed.enabled %}
  36. <div class="sidebar-content syndicate">
  37. <h4>Syndicate</h4>
  38. <a class="button" href="{{ feed_url }}.atom"><i class="fa fa-rss-square"></i> Atom 1.0</a>
  39. <a class="button" href="{{ feed_url }}.rss"><i class="fa fa-rss-square"></i> RSS</a>
  40. </div>
  41. {% endif %}