-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
44 lines (38 loc) · 1.54 KB
/
index.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
---
layout: default
title: Accueil
---
{% include header-home.html %}
<div class="container-full">
<div class="container grid-xl">
<div class="columns negative-m-s">
<div class="column col-12 text-center">
<h6 class="text-secondary">Selectionnez une catégorie</h6>
</div>
<!-- List to stores the main categories -->
{% assign mainCategories = '' | split: '' %}
<!-- Loop on all pages -->
{% for p in site.pages %}
<!-- Some processing on the url to detect main categories -->
{% assign urls = p.url | split: "/" %}
{% assign pathDepth = urls.size | minus: 1 %}
{% assign urlLastIdx = p.url.size | minus: 1 %}
{% assign lastChar = p.url | slice: urlLastIdx %}
<!-- Only save pages having an url of the form /[something]/ -->
{% if pathDepth == 1 and lastChar == "/" %}
{% assign mainCategories = mainCategories | push: p %}
{% endif %}
{% endfor %}
<!-- Sort main categories by rank -->
{% assign mainCategories = mainCategories | sort: 'rank' %}
<!-- Display categories starting by lower rank -->
{% for p in mainCategories %}
<!-- If hidden is not true, display -->
{% if p.hidden != true %}
{% include category-card.html page_name=p.url %}
{% endif %}
{% endfor %}
{% include more-help.html %}
</div>
</div>
</div>