-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnews.html
More file actions
82 lines (72 loc) · 2.45 KB
/
news.html
File metadata and controls
82 lines (72 loc) · 2.45 KB
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
---
layout: page
permalink: /news/
---
<h1>News</h1>
<!-- Year Navigation -->
<p>
<a href="#all">All</a>
{% assign years = site.data.news | map: "year" | uniq | sort | reverse %}
{% for y in years %}
| <a href="#{{ y }}">{{ y }}</a>
{% endfor %}
</p>
<div id="all"></div> <!-- Anchor for 'All' -->
{% assign month_order = "DECEMBER,NOVEMBER,OCTOBER,SEPTEMBER,AUGUST,JULY,JUNE,MAY,APRIL,MARCH,FEBRUARY,JANUARY" | split: "," %}
{% assign years = site.data.news | map: "year" | uniq | sort | reverse %}
{% for year in years %}
<h2 id="{{ year }}">{{ year }}</h2>
{% assign all_months = site.data.news | where: "year", year | map: "month" | uniq %}
{% assign months = "" | split: "" %}
{% for m in month_order %}
{% if all_months contains m %}
{% assign months = months | push: m %}
{% endif %}
{% endfor %}
{% for month in months %}
<h3>{{ month }}</h3>
<ul>
{% for news_item in site.data.news %}
{% assign m_trimmed = news_item.month | upcase | strip %}
{% if news_item.year == year and m_trimmed == month %}
<li style="margin-bottom: 20px;">
<strong style="font-size: 1.25rem;">{{ news_item.title }}</strong><br>
{% if news_item.description %}
<p>{{ news_item.description }}</p>
{% endif %}
{% if news_item.photo %}
<img src="{{ news_item.photo }}" alt="News Image" style="max-width: 300px; display: block; margin-top: 10px;">
{% endif %}
{% if news_item.link %}
<p><a href="{{ news_item.link }}" target="_blank">More Info</a></p>
{% endif %}
</li>
{% endif %}
{% endfor %}
</ul>
{% endfor %}
{% endfor %}
</div>
<!-- Optional Pagination Controls if Needed (non-functional without plugin) -->
<!--
<div class="pagination">
<span class="previous">
{% if paginator.previous_page %}
<a href="{{ paginator.previous_page_path }}">Previous</a>
{% else %}
<span>Previous</span>
{% endif %}
</span>
<span class="next">
{% if paginator.next_page %}
<a href="{{ paginator.next_page_path }}">Next</a>
{% else %}
<span>Next</span>
{% endif %}
</span>
</div>
-->
<!-- Back to Top Button -->
<div style="text-align: center; margin-top: 3em;">
<a href="#top" style="font-weight: bold; text-decoration: underline;">Back to Top</a>
</div>