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. {% include 'partials/simplesearch_searchbox.html.twig' %}
  6. </div>
  7. {% endif %}
  8. {% if config.plugins.relatedpages.enabled and related_pages|length > 0 %}
  9. <div class="sidebar-content">
  10. <h4>{{ 'SIDEBAR.RELATED_POSTS.HEADLINE'|t }}</h4>
  11. {% include 'partials/relatedpages.html.twig' %}
  12. </div>
  13. {% endif %}
  14. {% if config.plugins.random.enabled %}
  15. <div class="sidebar-content">
  16. <h4>{{ 'SIDEBAR.RANDOM_ARTICLE.HEADLINE'|t }}</h4>
  17. <a class="button" href="{{ base_url }}/random"><i class="fa fa-retweet"></i> {{ 'SIDEBAR.RANDOM_ARTICLE.FEELING_LUCKY'|t }}</a>
  18. </div>
  19. {% endif %}
  20. {{ page.find('/modules/sidebar').content }}
  21. {% if config.plugins.taxonomylist.enabled %}
  22. <div class="sidebar-content">
  23. <h4>{{ 'SIDEBAR.POPULAR_TAGS.HEADLINE'|t }}</h4>
  24. {% include 'partials/taxonomylist.html.twig' with {'base_url':new_base_url, 'taxonomy':'tag'} %}
  25. </div>
  26. {% endif %}
  27. {% if config.plugins.archives.enabled %}
  28. <div class="sidebar-content">
  29. <h4>{{ 'SIDEBAR.ARCHIVES.HEADLINE'|t }}</h4>
  30. {% include 'partials/archives.html.twig' with {'base_url':new_base_url} %}
  31. </div>
  32. {% endif %}
  33. {% if config.plugins.feed.enabled %}
  34. <div class="sidebar-content syndicate">
  35. <h4>{{ 'SIDEBAR.SYNDICATE.HEADLINE'|t }}</h4>
  36. <a class="btn" href="{{ feed_url }}.atom"><i class="fa fa-rss-square"></i> Atom 1.0</a>
  37. <a class="btn" href="{{ feed_url }}.rss"><i class="fa fa-rss-square"></i> RSS</a>
  38. </div>
  39. {% endif %}