sidebar.html.twig 1.8 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>{{ 'SIDEBAR.SIMPLE_SEARCH.HEADLINE'|t }}</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>{{ 'SIDEBAR.RELATED_POSTS.HEADLINE'|t }}</h4>
  11. {% include 'partials/relatedpages.html.twig' %}
  12. {% endif %}
  13. {% if config.plugins.random.enabled %}
  14. <div class="sidebar-content">
  15. <h4>{{ 'SIDEBAR.RANDOM_ARTICLE.HEADLINE'|t }}</h4>
  16. <a class="button" href="{{ base_url }}/random"><i class="fa fa-retweet"></i> {{ 'SIDEBAR.RANDOM_ARTICLE.FEELING_LUCKY'|t }}</a>
  17. </div>
  18. {% endif %}
  19. <div class="sidebar-content">
  20. <h4>{{ 'SIDEBAR.SOME_TEXT_WIDGET.HEADLINE'|t }}</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>{{ 'SIDEBAR.POPULAR_TAGS.HEADLINE'|t }}</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>{{ 'SIDEBAR.ARCHIVES.HEADLINE'|t }}</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>{{ 'SIDEBAR.SYNDICATE.HEADLINE'|t }}</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 %}