tagcloud errorr with links (#9)

Fix error with links in blog (check Disroot/Website#303)

Co-authored-by: meaz <meaz@disroot.org>
Reviewed-on: Disroot/grav-theme-disrootblog#9
Co-authored-by: meaz <meaz@no-reply@disroot.org>
Co-committed-by: meaz <meaz@no-reply@disroot.org>
This commit is contained in:
meaz 2022-01-08 05:46:30 +00:00
parent ed55ea17a2
commit 7e4956e0a6
2 changed files with 1 additions and 28 deletions

View File

@ -20,7 +20,7 @@
{% elseif percent >= 50 and percent < 80 %}
{% set class = 'large' %}
{% endif %}
<span class="{{ class }}" title="{{ value }} posts"><a href="{{ base_url }}/blog/tag{{ config.system.param_sep }}{{ tax|e('url') }}">{{ tax }}</a></span>
<span class="{{ class }}" title="{{ value }} posts"><a href="/blog/tag{{ config.system.param_sep }}{{ tax|e('url') }}">{{ tax }}</a></span>
{% endif %}
{% endfor %}
</div>

View File

@ -1,27 +0,0 @@
{% set taxlist = taxonomylist.get() %}
{% if taxlist %}
{% set max = max(taxlist['tag']) %}
{% set threshold = 0 %}
{% if config.plugins.tagcloud.threshold is defined %}
{% set threshold = config.plugins.tagcloud.threshold %}
{% endif %}
<div id="tagcloud">
{% for tax,value in taxlist['tag']|ksort %}
{% set percent = (value / max) * 100 %}
{% if percent > threshold %}
{% set class = 'largest' %}
{% if percent < 20 %}
{% set class = 'smallest' %}
{% elseif percent >= 20 and percent < 40 %}
{% set class = 'small' %}
{% elseif percent >= 40 and percent < 60 %}
{% set class = 'medium' %}
{% elseif percent >= 50 and percent < 80 %}
{% set class = 'large' %}
{% endif %}
<span class="{{ class }}" title="{{ value }} posts"><a href="/blog/tag{{ config.system.param_sep }}{{ tax|e('url') }}">{{ tax }}</a></span>
{% endif %}
{% endfor %}
</div>
{% endif %}