Skip to content

Commit

Permalink
Separate taxonomy tags based on language. Thanks to getgrav/grav-plug…
Browse files Browse the repository at this point in the history
  • Loading branch information
QSaman committed Jun 8, 2020
1 parent bf8d7a6 commit 7b8ad78
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions templates/partials/sidebar.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{% set feed_url = blog.url == '/' or blog.url == base_url_relative ? (base_url_relative~'/'~blog.slug) : blog.url %}
{% set new_base_url = blog.url == '/' ? '' : blog.url %}

{% if config.plugins.simplesearch.enabled %}
<div class="sidebar-content">
{% include 'partials/simplesearch_searchbox.html.twig' %}
</div>
{% endif %}
{% if config.plugins.relatedpages.enabled and related_pages|length > 0 %}
<div class="sidebar-content">
<h4>{{ 'THEME_QUARK.SIDEBAR.RELATED_POSTS.HEADLINE'|t }}</h4>
{% include 'partials/relatedpages.html.twig' %}
</div>
{% endif %}
{% if config.plugins.random.enabled %}
<div class="sidebar-content">
<h4>{{ 'THEME_QUARK.SIDEBAR.RANDOM_ARTICLE.HEADLINE'|t }}</h4>
<a class="button" href="{{ base_url }}/random"><i class="fa fa-retweet"></i> {{ 'THEME_QUARK.SIDEBAR.RANDOM_ARTICLE.FEELING_LUCKY'|t }}</a>
</div>
{% endif %}

{{ page.find('/modules/sidebar').content|raw }}

{% if config.plugins.taxonomylist.enabled %}
<div class="sidebar-content">
<h4>{{ 'THEME_QUARK.SIDEBAR.POPULAR_TAGS.HEADLINE'|t }}</h4>
{% include 'partials/taxonomylist.html.twig' with {'base_url':new_base_url, 'taxonomy':config.plugins.taxonomylist.language[grav.language.getLanguage()].taxonomy} %}
</div>
{% endif %}
{% if config.plugins.archives.enabled %}
<div class="sidebar-content">
<h4>{{ 'THEME_QUARK.SIDEBAR.ARCHIVES.HEADLINE'|t }}</h4>
{% include 'partials/archives.html.twig' with {'base_url':new_base_url} %}
</div>
{% endif %}
{% if config.plugins.feed.enabled %}
<div class="sidebar-content syndicate">
<h4>{{ 'THEME_QUARK.SIDEBAR.SYNDICATE.HEADLINE'|t }}</h4>
<a class="btn" href="{{ feed_url }}.atom"><i class="fa fa-rss-square"></i> Atom 1.0</a>
<a class="btn" href="{{ feed_url }}.rss"><i class="fa fa-rss-square"></i> RSS</a>
{% if config.plugins.feed.enable_json_feed %}<a class="btn" href="{{ feed_url }}.json"><i class="fa fa-rss-square"></i> JSON</a>{% endif %}
</div>
{% endif %}

0 comments on commit 7b8ad78

Please sign in to comment.