|
1 | | -## Latest {{ include.header }}: |
2 | | - |
3 | | -<div> |
4 | | - {% assign main = include.main %} |
5 | | - {% assign secondary = include.secondary | split: ',' %} |
6 | | - |
7 | | - {% assign options = main | concat: secondary %} |
8 | | - {% assign second = options[1] | strip %} |
9 | | - |
10 | | - {% assign sorted_posts = site.pages | sort: main %} |
11 | | - |
12 | | - <div id="sortOptions"> |
13 | | - |
14 | | - <i>Sort by:</i> |
15 | | - <br /> |
16 | | - {% for opt in options %} |
17 | | - <label style="margin-right: 20px"> |
18 | | - <input type="radio" name="sortBy" value="{{ opt | strip }}" {% if forloop.first %}checked{% endif %}> |
19 | | - {{ opt | capitalize }} |
20 | | - </label> |
21 | | - {% endfor %} |
22 | | - |
23 | | - <br /> |
24 | | - <i>Order:</i><br /> |
25 | | - <label id="labelAsc"> |
26 | | - <input type="radio" name="sortOrder" value="asc" checked> |
27 | | - </label> |
28 | | - <label id="labelDesc" style="margin-left: 20px;"> |
29 | | - <input type="radio" name="sortOrder" value="desc"> |
30 | | - </label> |
31 | | - |
32 | | - </div> |
33 | | - |
34 | | - |
35 | | - |
36 | | - <ul id="itemList"> |
37 | | - {% for post in sorted_posts %} |
38 | | - {% if post.path contains include.area and post[main] %} |
39 | | - <li data-{{ main }}="{{ post[main] }}" |
40 | | - {% if secondary %} |
41 | | - {% for opt in secondary %} |
42 | | - data-{{opt}}="{{ post[opt] | downcase }}" |
43 | | - {% endfor %} |
| 1 | +<style> |
| 2 | + .container { |
| 3 | + display: flex; |
| 4 | + flex-direction: column; |
| 5 | + gap: 0rem; |
| 6 | + } |
| 7 | + |
| 8 | + .row2 { |
| 9 | + display: flex; |
| 10 | + gap: 1rem; |
| 11 | + } |
| 12 | + |
| 13 | + .row2 .first { |
| 14 | + flex: none; |
| 15 | + } |
| 16 | + |
| 17 | + .row2 .last { |
| 18 | + flex: 1; |
| 19 | + } |
| 20 | + |
| 21 | + @media (max-width: 600px) { |
| 22 | + .row2 { |
| 23 | + flex-direction: column; |
| 24 | + } |
| 25 | + } |
| 26 | +</style> |
| 27 | + |
| 28 | +<hr/> |
| 29 | + |
| 30 | +<div class="container"> |
| 31 | + <!--<h4 class="text-epsilon">Latest {{ include.header }}</h4>--> |
| 32 | + |
| 33 | + <div> |
| 34 | + {% assign main = include.main %} |
| 35 | + {% assign secondary = include.secondary | split: ',' %} |
| 36 | + |
| 37 | + {% assign options = main | concat: secondary %} |
| 38 | + {% assign second = options[1] | strip %} |
| 39 | + |
| 40 | + {% assign sorted_posts = site.pages | sort: main %} |
| 41 | + |
| 42 | + <div class="row2" id="sortOptions"> |
| 43 | + |
| 44 | + <div class="first"> |
| 45 | + <h4 class="text-delta"><i>Sort by:</i></h4> |
| 46 | + {% for opt in options %} |
| 47 | + <label style="margin-right: 20px"> |
| 48 | + <input type="radio" name="sortBy" value="{{ opt | strip }}" {% if forloop.first %}checked{% endif %}> |
| 49 | + {{ opt | capitalize }} |
| 50 | + </label> |
| 51 | + {% endfor %} |
| 52 | + </div> |
| 53 | + |
| 54 | + |
| 55 | + <div class="last"> |
| 56 | + <h4 class="text-delta"><i>Order by:</i></h4> |
| 57 | + <label id="labelAsc"> |
| 58 | + <input type="radio" name="sortOrder" value="asc" checked> |
| 59 | + </label> |
| 60 | + <label id="labelDesc" style="margin-left: 20px;"> |
| 61 | + <input type="radio" name="sortOrder" value="desc"> |
| 62 | + </label> |
| 63 | + </div> |
| 64 | + </div> |
| 65 | + |
| 66 | + <h4 class="text-delta"><i>{{ include.header }}:</i></h4> |
| 67 | + <ul id="itemList"> |
| 68 | + {% for post in sorted_posts %} |
| 69 | + {% if post.path contains include.area and post[main] %} |
| 70 | + <li data-{{ main }}="{{ post[main] }}" |
| 71 | + {% if secondary %} |
| 72 | + {% for opt in secondary %} |
| 73 | + data-{{opt}}="{{ post[opt] | downcase }}" |
| 74 | + {% endfor %} |
| 75 | + {% endif %} |
| 76 | + > |
| 77 | + <a href="{{ post.url }}"> |
| 78 | + {{ post[main]}} |
| 79 | + {% if secondary %} |
| 80 | + ➝ |
| 81 | + {% for sec in secondary %} |
| 82 | + {{post[sec]}}{% unless forloop.last %}, {% endunless %} |
| 83 | + {% endfor %} |
| 84 | + {% endif %} |
| 85 | + </a> |
| 86 | + </li> |
44 | 87 | {% endif %} |
45 | | - > |
46 | | - <a href="{{ post.url }}"> |
47 | | - {{ post[main]}} |
48 | | - {% if secondary %} |
49 | | - ➝ |
50 | | - {% for sec in secondary %} |
51 | | - {{post[sec]}}{% unless forloop.last %}, {% endunless %} |
52 | | - {% endfor %} |
53 | | - {% endif %} |
54 | | - </a> |
55 | | - </li> |
56 | | - {% endif %} |
57 | | - {% endfor %} |
58 | | - </ul> |
| 88 | + {% endfor %} |
| 89 | + </ul> |
| 90 | + </div> |
59 | 91 | </div> |
60 | | - |
61 | 92 | <script> |
62 | 93 | document.addEventListener("DOMContentLoaded", () => { |
63 | 94 | function updateOrderLabels(sortField) { |
|
0 commit comments