|
24 | 24 |
|
25 | 25 | {% assign folders = "" | split: ", " %} |
26 | 26 | {% for image in site.static_files %} |
27 | | - {% if image.path contains 'criterion/' %} |
28 | | - {% assign imagepath = image.path | split: "/" %} |
29 | | - {% for subpath in imagepath %} |
30 | | - {% if forloop.index0 == 3 %} |
31 | | - {% assign folders = folders | append: pathName %} |
32 | | - {% endif %} |
33 | | - {% endfor %} |
34 | | - {% endif %} |
| 27 | +{% if image.path contains 'criterion/' %} |
| 28 | +{% assign imagepath = image.path | split: "/" %} |
| 29 | +{% for subpath in imagepath %} |
| 30 | +{% if forloop.index0 == 3 %} |
| 31 | +{% assign folders = folders | append: pathName %} |
| 32 | +{% endif %} |
| 33 | +{% endfor %} |
| 34 | +{% endif %} |
35 | 35 | {% endfor %} |
36 | 36 | {% assign folders = folders | uniq %} |
37 | 37 |
|
| 38 | +<!-- The code block below does exactly the same as the one above, which one is cleaner? --> |
38 | 39 | <!-- {% assign folders = "" | split: ", " %} |
39 | 40 | {% for folder in site.static_files %} |
40 | 41 | {% if folder.path contains 'criterion/' %} |
|
63 | 64 | <li{%ifforloop.index==1%}class="active"{%endif%}> |
64 | 65 | <br> |
65 | 66 | {% for image in site.static_files %} |
66 | | - {% if image.path contains folder %} |
67 | | -<figure> |
68 | | -<imgsrc="{{ site.baseurl }}{{ image.path }}"alt="image"/> |
69 | | -<figcaption>{{ image.name }}</figcaption> |
70 | | -</figure> |
71 | | - {% endif %} |
| 67 | +{% if image.path contains folder %} |
| 68 | +<figure> |
| 69 | +<imgsrc="{{ site.baseurl }}{{ image.path }}"alt="image"/> |
| 70 | +<figcaption>{{ image.name }}</figcaption> |
| 71 | +</figure> |
| 72 | +{% endif %} |
72 | 73 | {% endfor%} |
73 | 74 | </li> |
74 | 75 | {% endfor%} |
|