Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support pre-release builds in What's New page #2

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions _data/releases.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# This lists all the releases so the front page can automatically reference the
# release number and our "What's New" page works.
- 178
- 177
- 176
- 174
- 173
- 172
- 171
- 170
- 169
- 166
- 165

# The prereleases list should only be filled if there's an active prerelease.
# Otherwise it should be empty.
prereleases:

releases:
- 178
- 177
- 176
- 174
- 173
- 172
- 171
- 170
- 169
- 166
- 165
2 changes: 0 additions & 2 deletions _includes/releases/r176.1.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<p>MacVim r176.1 (prerelease)</p>

<p>Updated to Vim 9.0.1403</p>

<ul>
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
---
<!DOCTYPE html>
{% assign latest_release=site.data.releases[0] %}
{% assign latest_release=site.data.releases.releases[0] %}
<html lang="en-us">
<head>
<meta charset="UTF-8">
Expand Down
1 change: 0 additions & 1 deletion javascripts/main.js

This file was deleted.

19 changes: 13 additions & 6 deletions release-notes/whatsnew.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,14 @@
</style>
</head>
<body>
{% for release in site.data.releases %}
{% for release in site.data.releases.prereleases %}
<section id={{ release }}>
<header> <h1>MacVim r{{ release }} (prerelease)</h1></header>
{% include releases/r{{ release }}.html %}
</section>
{% endfor %}

{% for release in site.data.releases.releases %}

{% comment %}
We try to show more than 1 releases in case the user is doing a multiple
Expand All @@ -100,18 +107,18 @@
let fromRev = NaN;
let toRev = NaN;
if (params.has('from') && params.has('to')) {
fromRev = parseInt(params.get('from'));
toRev = parseInt(params.get('to'));
fromRev = parseFloat(params.get('from'));
toRev = parseFloat(params.get('to'));
}
else if (params.has('version')) {
toRev = parseInt(params.get('version'));
toRev = parseFloat(params.get('version'));
fromRev = toRev - 1;
}
if (!isNaN(fromRev) && !isNaN(toRev)) {
let foundOne = false;
let sections = document.getElementsByTagName('section');
for (let i = 0; i < sections.length; i++) {
const secRev = parseInt(sections[i].id);
const secRev = parseFloat(sections[i].id);
if (!isNaN(secRev)) {
if (secRev <= fromRev || secRev > toRev)
sections[i].style.display = 'none';
Expand All @@ -122,7 +129,7 @@
}
}
if (!foundOne) {
sections[0].style.display = 'block'; // Just show the latest if the input range is not valid so we don't show an empty page
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
}
}
</script>
Expand Down