|
@@ -48,15 +48,23 @@
|
|
|
{# looping over all pages to pick out what we need (i.e. pages with tags) #}
|
|
|
{% set tag_count = {} %} {# tag_count contains: tag : count of occurences #}
|
|
|
{% set tag_pages = {} %} {# tag_pages contains: tag : page ids of occurences hash '#' separated #}
|
|
|
+ {% set aut_count = {} %} {# aut_count contains: author : count of occurences #}
|
|
|
+ {% set aut_pages = {} %} {# aut_pages contains: author : page ids of occurences hash '#' separated #}
|
|
|
{% set tbpages = {} %} {# contains ALL pages to be considered, saves some cycles later on #}
|
|
|
- {% for page in pages if page.meta.tags %}
|
|
|
- {% set tbpages = tbpages|merge([page]) %}
|
|
|
- {% for tag in page.meta.tags|split(',') %}
|
|
|
- {# tag_count contains: tag : count of occurences #}
|
|
|
- {% set tag_count = tag_count|merge({(tag):(tag_count[tag] + 1)}) %}
|
|
|
- {# tag_pages contains: tag : page ids of occurences hash '#' separated #}
|
|
|
- {% set tag_pages = tag_pages|merge( { (tag) : (tag_pages[tag] ~ '#' ~ page.id) } ) %}
|
|
|
- {% endfor %}
|
|
|
+ {% for page in pages if page.meta.tags or page.meta.author %}
|
|
|
+ {% if page.meta.tags %}
|
|
|
+ {% set tbpages = tbpages|merge([page]) %}
|
|
|
+ {% for tag in page.meta.tags|split(',') %}
|
|
|
+ {# tag_count contains: tag : count of occurences #}
|
|
|
+ {% set tag_count = tag_count|merge({(tag):(tag_count[tag] + 1)}) %}
|
|
|
+ {# tag_pages contains: tag : page ids of occurences hash '#' separated #}
|
|
|
+ {% set tag_pages = tag_pages|merge( { (tag) : (tag_pages[tag] ~ '#' ~ page.id) } ) %}
|
|
|
+ {% endfor %}
|
|
|
+ {% endif %}
|
|
|
+ {% if page.meta.author %}
|
|
|
+ {% set aut_count = aut_count|merge({(page.meta.author):(aut_count[page.meta.author] + 1)}) %}
|
|
|
+ {% set aut_pages = aut_pages|merge({(page.meta.author):(aut_pages[page.meta.author]~'#'~page.id)}) %}
|
|
|
+ {% endif %}
|
|
|
{% endfor %}
|
|
|
|
|
|
{# sort tag_count into tag_sorting, according to config options #}
|