Skip to content

Commit b401e6f

Browse files
committed
Add date display to What's New
Because we are using a flex box to align the header and date now, also need to do misc annoying adjustments to the CSS as it has different behaviors than when the h1 element was using the default block display.
1 parent 3bd2994 commit b401e6f

File tree

3 files changed

+59
-23
lines changed

3 files changed

+59
-23
lines changed

_data/releases.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,24 @@
66
prereleases:
77

88
releases:
9-
- 181
10-
- 180
11-
- 179
12-
- 178
13-
- 177
14-
- 176
15-
- 174
16-
- 173
17-
- 172
18-
- 171
19-
- 170
20-
- 169
21-
- 166
22-
- 165
9+
- num: 181
10+
date: "2025-02-21T05:06:34Z"
11+
- num: 180
12+
date: "2024-09-11T09:26:43Z"
13+
- num: 179
14+
date: "2024-01-05T05:55:55Z"
15+
- num: 178
16+
date: "2023-09-12T10:47:30Z"
17+
- num: 177
18+
date: "2023-07-10T02:03:53Z"
19+
- num: 176
20+
date: "2023-02-07T12:54:46Z"
21+
- num: 174
22+
date: "2022-09-15T21:08:01Z"
23+
- num: 173
24+
- num: 172
25+
- num: 171
26+
- num: 170
27+
- num: 169
28+
- num: 166
29+
- num: 165

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
---
33
<!DOCTYPE html>
4-
{% assign latest_release=site.data.releases.releases[0] %}
4+
{% assign latest_release=site.data.releases.releases[0].num %}
55
<html lang="en-us">
66
<head>
77
<meta charset="UTF-8">

release-notes/whatsnew.html

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
<meta name="description" content="List of recent MacVim release notes to show what's new.">
88
<title>What's New in MacVim</title>
99

10+
<link rel="shortcut icon" href="../images/favicon-macvim-16.png">
11+
<link rel="icon" type="image/png" sizes="256x256" href="../images/favicon-macvim-256.png">
12+
<link rel="icon" type="image/png" sizes="128x128" href="../images/favicon-macvim-128.png">
13+
<link rel="icon" type="image/png" sizes="64x64" href="../images/favicon-macvim-64.png">
14+
<link rel="icon" type="image/png" sizes="32x32" href="../images/favicon-macvim-32.png">
15+
<link rel="icon" type="image/png" sizes="16x16" href="../images/favicon-macvim-16.png">
16+
1017
<!--
1118
This page serves as a list of recent release notes. By default all but the
1219
latest release is hidden but the caller can use URL parameters to enable
@@ -38,6 +45,8 @@
3845
body {
3946
font-family: -apple-system-font, -apple-system, sans-serif;
4047
font: -apple-system-body !important;
48+
49+
margin-top: 0px; /* we use flex box for the h1 and need this to avoid adding too much padding */
4150
}
4251

4352
hr {
@@ -46,14 +55,25 @@
4655

4756
section > header {
4857
font-size: 130%;
49-
color: #599A42;
5058
border-bottom: 3px solid #57c4d0;
59+
60+
display: flex; /* use flex to show a date on the right */
61+
align-items: baseline;
62+
}
63+
section > header > h1 {
64+
color: #599A42;
65+
flex-grow: 1;
66+
margin-top: 0.67em;
5167
}
5268
@media (prefers-color-scheme: dark) {
53-
section > header {
69+
section > header > h1 {
5470
color: rgb(48,209,88);
5571
}
5672
}
73+
section > header > time {
74+
font-size: 65%;
75+
opacity: 0.5;
76+
}
5777

5878
section > h1 {
5979
padding-bottom: .3em;
@@ -140,6 +160,7 @@
140160
#hidetoc-btn {
141161
display: inherit;
142162
position: fixed;
163+
top: 1em;
143164
right: 1.5em;
144165
z-index: 1;
145166
opacity: 0.2;
@@ -168,9 +189,9 @@
168189
</nav>
169190

170191
{% for release in site.data.releases.prereleases %}
171-
<section id={{ release }}>
172-
<header> <h1>MacVim r{{ release }} (prerelease)</h1></header>
173-
{% include releases/r{{ release }}.html %}
192+
<section id={{ release.num }}>
193+
<header> <h1>MacVim r{{ release.num }} (prerelease)</h1><time datetime={{ release.date }}></time></header>
194+
{% include releases/r{{ release.num }}.html %}
174195
</section>
175196
{% endfor %}
176197

@@ -185,9 +206,9 @@
185206
{% break %}
186207
{% endif %}
187208

188-
<section id={{ release }} class=item-{{ forloop.index0 }}>
189-
<header> <h1>MacVim r{{ release }}</h1></header>
190-
{% include releases/r{{ release }}.html %}
209+
<section id={{ release.num }} class=item-{{ forloop.index0 }}>
210+
<header> <h1>MacVim r{{ release.num }}</h1><time datetime={{ release.date }}></time></header>
211+
{% include releases/r{{ release.num }}.html %}
191212
</section>
192213

193214
{% endfor %}
@@ -235,6 +256,14 @@
235256
document.getElementsByClassName('item-0')[0].style.display = 'block'; // Just show the latest if the input range is not valid so we don't show an empty page
236257
}
237258
}
259+
260+
// Convert to local time zone and date display
261+
let dateTimeElems = document.getElementsByTagName('time');
262+
for (let elem of dateTimeElems) {
263+
if (elem.dateTime)
264+
elem.innerText = (new Date(elem.dateTime)).toLocaleDateString();
265+
}
266+
238267
// We have multiple TOCs. We patch it by making a new master list and put every TOC under it.
239268
if (tocs.length > 1) {
240269
let parentNode = tocs[0].elem.parentNode;

0 commit comments

Comments
 (0)