Skip to content

Commit 489868b

Browse files
Refactor old_mcversions -> supported_mcversions
1 parent f673f30 commit 489868b

3 files changed

Lines changed: 17 additions & 53 deletions

File tree

_config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ feed:
2323

2424
latest_mcversion: "26.1.2"
2525

26+
supported_mcversions:
27+
- "26.1.2"
28+
- "1.21.11"
29+
2630
mc_version_aliases:
2731
"1.7": "1.7.2 - 1.7.10 (built on 1.7.2)"
2832
"1.8 OF": "1.8 - 1.8.9 + OptiFine (built on 1.8)"

_scripts/add_wurst_port.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@ def add_download_category(new_version, old_latest):
9696
new_page_path.write_text(textwrap.dedent(new_page_content), encoding="utf-8")
9797

9898

99+
def mark_version_as_supported(config, new_version):
100+
"""Mark a newly added Minecraft version as supported on the download page."""
101+
if "supported_mcversions" not in config:
102+
config["supported_mcversions"] = []
103+
if new_version not in config["supported_mcversions"]:
104+
config["supported_mcversions"].insert(0, new_version)
105+
106+
99107
def update_latest_release(new_version):
100108
"""Update all necessary files when the latest Minecraft release changes."""
101109
config_path = Path("_config.yml")
@@ -106,6 +114,7 @@ def update_latest_release(new_version):
106114
return # Already up to date
107115

108116
config["latest_mcversion"] = new_version
117+
mark_version_as_supported(config, new_version)
109118
util.write_data_file(config_path, config)
110119

111120
update_install_guide(new_version)

download/index.html

Lines changed: 4 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -61,55 +61,6 @@
6161
- "1.9"
6262
- "1.8"
6363
- "1.7"
64-
old_mcversions:
65-
- "1.7"
66-
- "1.8"
67-
- "1.9"
68-
- "1.10"
69-
- "1.11"
70-
- "1.12"
71-
- 1.14.2
72-
- 1.14.3
73-
- 1.14.4
74-
- "1.15"
75-
- 1.15.1
76-
- 1.15.2
77-
- "1.16"
78-
- 1.16.1
79-
- 1.16.2
80-
- 1.16.3
81-
- 1.16.4
82-
- 1.16.5
83-
- "1.17"
84-
- 1.17.1
85-
- "1.18"
86-
- 1.18.1
87-
- 1.18.2
88-
- "1.19"
89-
- 1.19.1
90-
- 1.19.2
91-
- 1.19.3
92-
- 1.19.4
93-
- "1.20"
94-
- 1.20.1
95-
- 1.20.2
96-
- 1.20.3
97-
- 1.20.4
98-
- 1.20.5
99-
- 1.20.6
100-
- "1.21"
101-
- 1.21.1
102-
- 1.21.2
103-
- 1.21.3
104-
- 1.21.4
105-
- 1.21.5
106-
- 1.21.6
107-
- 1.21.7
108-
- 1.21.8
109-
- 1.21.9
110-
- 1.21.10
111-
- "26.1"
112-
- 26.1.1
11364
google_adsense: true
11465
---
11566
{%- include title.html l1 = page.title l2 = page.description -%}
@@ -198,17 +149,17 @@ <h2 class="text-accent text-bold">Wurst for Minecraft {{ upcoming_version }} is
198149

199150
<section class="padding10 no-padding-left no-padding-right">
200151
<a href="{{ allversions }}" class="fg-gray">
201-
<div class="margin10 no-margin-left no-margin-right padding10 no-padding-top no-padding-bottom bg-grayLighter {% if page.old_mcversions contains mcversion %}fg-grayLight{% else %}fg-gray{% endif %} set-border">
202-
<h2 class="{% if page.old_mcversions contains mcversion %}text-light{% endif %}">
152+
<div class="margin10 no-margin-left no-margin-right padding10 no-padding-top no-padding-bottom bg-grayLighter {% if mcversion != "all" and mcversion != "snapshots" and site.supported_mcversions contains mcversion %}fg-gray{% elsif mcversion != "all" and mcversion != "snapshots" %}fg-grayLight{% else %}fg-gray{% endif %} set-border">
153+
<h2 class="{% if mcversion != "all" and mcversion != "snapshots" and site.supported_mcversions contains mcversion %}{% else %}{% if mcversion != "all" and mcversion != "snapshots" %}text-light{% endif %}{% endif %}">
203154
{%- if mcversion == "all" -%}
204155
Latest Wurst Updates
205156
{%- elsif mcversion == "snapshots" -%}
206157
Snapshots, Pre-Releases, etc.
207158
{%- else -%}
208159
Wurst for Minecraft {% if site.mc_version_aliases[mcversion] %}{{ site.mc_version_aliases[mcversion] }}{% else %}{{ mcversion }}{% endif %}
209-
{%- if page.old_mcversions contains mcversion %}
160+
{%- unless mcversion == "all" or mcversion == "snapshots" or site.supported_mcversions contains mcversion %}
210161
<span class="tag fg-white bg-amber" style="cursor: help;vertical-align: baseline;" title="I'm no longer maintaining this version. You can still use it, but any bugs or missing features will not be fixed.">OLD</span>
211-
{%- endif -%}
162+
{%- endunless -%}
212163
{%- endif -%}
213164
</h2>
214165
</div>

0 commit comments

Comments
 (0)