{#-
    boilerplate/tags_coud.html
    ~~~~~~~~~~~~~~~~~~~~~~~~~~

    Sidebar cloud of tags.
    Min and max for font sizes can be configured, values are in pt.

    :copyright: Copyright 2012 by Iñigo Serna
    :license: FreeBSD, see LICENSE file
-#}

{%- set fontsize_min = 8 -%}
{%- set fontsize_max = 20 -%}

<div class="widget">
    <h1>{{ text_tags_cloud }}</h1>
    {%- set count_min = 1 -%}
    {%- set count_max = tags.values()|sort|last -%}
    {%- for tag, x in tags|dictsort -%}
      {%- set size = (fontsize_max-fontsize_min)*(x-count_min)/(count_max-count_min) + fontsize_min -%}
      <a href="{{ pathto('tags/' + taglinks[tag]) }}" style="font-size: {{ size|int }}pt">{{ tag }}</a>
      {%- if not loop.last -%}&nbsp;&nbsp;{%- endif -%}
    {%- endfor -%}
</div>
