-
Notifications
You must be signed in to change notification settings - Fork 0
/
categories.html
165 lines (164 loc) · 11.5 KB
/
categories.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
---
layout: category_list
title: Explore Categories
add_to_menu: false
description: "Meta description for Support page"
keywords: "responsive,jekyll,minimal template"
---
<div class="topics-area bg-color1">
<div class="topics-wrapper section-spacing bminus-30">
<div class="container">
<div class="col">
<!--ELENCO DI TUTTE LE CATEGORIE-->
{% assign article_number = 0 %}
{% for category in site.data.category.category %}
{% capture category_name %}{{ category.key}}{% endcapture %}
{% capture category_label %}{{ category.label}}{% endcapture %}
{% capture category_draft %}{{ category.draft}}{% endcapture %}
{% capture category_type %}{{ category.type}}{% endcapture %}
{% if category_draft == "false" and category_type == '(categoria)' and category.size > 0 %}
{% assign display_mode = site.data.topicsarea.display_mode %}
<!--CONTATORE POST DELLA CATEGORIA-->
{% assign article_number = 0 %}
{% assign all_posts_of_category = site.categories[category_name] | where: 'category_key', nil | where: 'draft' ,'false' %}
{% if display_mode == "article_in_category" %}
{% if all_posts_of_category.size > 0 %}
{% assign all_posts_of_category_ord = site.categories[category_name] | where: 'category_key', nil | where: 'draft' ,'false' | sort: "order" %}
{% for doc_post in all_posts_of_category_ord %}
{% capture post_draft %}{{ doc_post.draft}}{% endcapture %}
{% if post_draft == "false" %}
<!--CONTA POST NELLA CATEGORIA-->
{% assign article_number = article_number | plus: 1 %}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% if display_mode == "all" %}
<!--CICLO SU TUTTI GLI ARTICOLI DELLA CATEGORIA-->
{% if all_posts_of_category.size > 0 %}
{% assign all_posts_of_category_ord = site.categories[category_name] | where: 'category_key', nil | where: 'draft' ,'false' | sort: "order" %}
{% for post in all_posts_of_category_ord %}
<!--CONTA POST NELLA CATEGORIA-->
{% assign article_number = article_number | plus: 1 %}
{% endfor %}
{% endif %}
{% endif %}
<!--PRENDO TUTTE LE SEZIONI SE SONO IN MODALITA' SEZIONI VISIBILI-->
{% if display_mode == "all" or display_mode == "article_in_section" %}
{% assign all_sections = site.data.category.category | where: 'category_key' , category_name | where: 'draft' ,'false' %}
<!--CICLO SU TUTTE LE SEZIONI DELLA CATEGORIA-->
{% for section in all_sections %}
<!--PRENDO TUTTE LE SEZIONI-->
{% capture section_key %}{{section.key}}{% endcapture %}
{% assign all_posts = site.categories[section_key] | where: 'draft' ,'false' %}
{% if section != category_name %}
<!--STAMPO GLI ARTICOLI DELLA SEZIONE-->
{% assign normal_posts = site.categories[section.key] | where: 'draft' ,'false' %}
{% if normal_posts.size > 0 %}
{% assign normal_posts_ord = site.categories[section.key] | where: 'draft' ,'false' | sort: "order" %}
{% for doc_post in normal_posts_ord %}
{% capture post_draft %}{{ doc_post.draft}}{% endcapture %}
{% if post_draft == "false" %}
<!--CONTA POST NELLA SEZIONE-->
{% assign article_number = article_number | plus: 1 %}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
<!--FINE CONTATORE-->
<div class="row">
<article class="topics-service bg-color3 wow fadeIn" data-wow-duration="3s">
<header class="topics-title">
<!--DEB1: {{category_name}}-->
<!--CONTROLLO CHE CI SIA ALMENO UN ARTICOLO NELLA CATEGORIA-->
{% assign all_posts = site.categories[category_name] | where: 'draft' ,'false' %}
{% assign my_category_url = "/categories/" | append: category.url %}
{% if article_number > 0 %}
<a href="{{ my_category_url | relative_url }}"><h5 class="heading-5 text-capitalize">{{ category_label }} ({{article_number}})</h5></a>
{% else %}
<h5 class="heading-5 text-capitalize">{{ category_label }} ({{article_number}})</h5>
{% endif %}
</header>
<!--{% assign display_mode = site.data.topicsarea.display_mode %}-->
{% assign all_posts_of_category = site.categories[category_name] | where: 'category_key', nil | where: 'draft' ,'false' %}
{% if display_mode == "article_in_category" %}
<ul class="topics-list list-inline">
{% if all_posts_of_category.size > 0 %}
{% assign all_posts_of_category_ord = site.categories[category_name] | where: 'category_key', nil | where: 'draft' ,'false' | sort: "order" %}
{% for doc_post in all_posts_of_category_ord %}
{% capture post_draft %}{{ doc_post.draft}}{% endcapture %}
{% if post_draft == "false" %}
<li><a href="{{ doc_post.url | relative_url }}">{{ doc_post.title }} </a></li>
{% endif %}
{% endfor %}
{% endif %}
</ul>
{% endif %}
{% if display_mode == "all" %}
<!--CICLO SU TUTTI GLI ARTICOLI DELLA CATEGORIA-->
{% if all_posts_of_category.size > 0 %}
{% assign all_posts_of_category_ord = site.categories[category_name] | where: 'category_key', nil | where: 'draft' ,'false' | sort: "order" %}
<ul class="topics-list list-inline">
{% for post in all_posts_of_category_ord %}
<li><a href="{{ post.url | relative_url }}">{{ post.title }} </a></li>
{% endfor %}
{% endif %}
</ul>
{% endif %}
<ul class="topics-list list-inline">
<!--PRENDO TUTTE LE SEZIONI SE SONO IN MODALITA' SEZIONI VISIBILI-->
{% if display_mode == "all" or display_mode == "article_in_section" %}
{% assign all_sections = site.data.category.category | where: 'category_key' , category_name | where: 'draft' ,'false' %}
<!--CICLO SU TUTTE LE SEZIONI DELLA CATEGORIA-->
{% for section in all_sections %}
<!--PRENDO TUTTE LE SEZIONI-->
{% capture section_key %}{{section.key}}{% endcapture %}
{% assign all_posts = site.categories[section_key] | where: 'draft' ,'false' %}
{% if section != category_name %}
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h6 class="heading-6" itemprop="headline">
<!-- COSTRUISCO URL SEZIONE -->
{% capture section_url %}{{ '/categories/' | append: section.url }}{% endcapture %}
<!--CAPISCO SE LA SEZIONE CONTIENE O MENO ARTICOLI-->
{% if all_posts.size > 0 %}
<hr>
<a href="{{ section_url | relative_url }}" rel="permalink">{{section.label}}</a>
{% else %}
{{section.label}}
{% endif %}
</h6>
<!--STAMPO GLI ARTICOLI DELLA SEZIONE-->
{% assign normal_posts = site.categories[section.key] | where: 'draft' ,'false' %}
{% if normal_posts.size > 0 %}
{% assign normal_posts_ord = site.categories[section.key] | where: 'draft' ,'false' | sort: "order" %}
{% for doc_post in normal_posts_ord %}
{% capture post_draft %}{{ doc_post.draft}}{% endcapture %}
{% if post_draft == "false" %}
<li><a href="{{ doc_post.url | relative_url }}"><h7 class="heading-7" itemprop="headline"></h7>{{ doc_post.title }} </a></li>
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
</ul>
</article>
</div>
{% endif %}
{% endfor %}
<!--DEB1:{{article_number}}-->
{% if article_number == 0 %}
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
<h7 class="heading-7" itemprop="headline">
<!-- MESSAGGIO NESSUNA SEZIONE-->
{{site.data.ui-text[site.locale].category_no | default: "Create an article in a category or section .." }}{{section.label}}
</h7>
{% endif %}
</div>
</div>
</div>
</div>
</section>
<!-- End Topics Area -->