Show build versions in downloads

This commit is contained in:
Holden
2026-06-28 13:38:11 -05:00
parent 64270eb0ff
commit eb88362700
3 changed files with 9 additions and 8 deletions

View File

@@ -75,6 +75,6 @@ const defaultDownload = downloads[0];
$downloadButton $downloadButton
.attr("href", download.href) .attr("href", download.href)
.attr("aria-label", `Download TenWholeYears for ${download.label}`) .attr("aria-label", `Download TenWholeYears for ${download.label}`)
.text(`Download for ${download.label}`); .text(`Download for ${download.label} (${download.version})`);
}); });
</script> </script>

View File

@@ -2,7 +2,6 @@ import { TWY_CDN_URL } from "astro:env/server";
import { api } from "$lib/api"; import { api } from "$lib/api";
import { ApiResult } from "$lib/types/api";
import type { LatestBuildsResponse } from "$lib/types/api/builds"; import type { LatestBuildsResponse } from "$lib/types/api/builds";
import windowsIcon from "$assets/images/platforms/platform-windows.png"; import windowsIcon from "$assets/images/platforms/platform-windows.png";
@@ -52,8 +51,10 @@ export const downloadPlatforms: DownloadPlatformConfig[] = [
export const buildDownloadOptions = ( export const buildDownloadOptions = (
latestVersions: LatestBuildsResponse, latestVersions: LatestBuildsResponse,
): DownloadOption[] => ): DownloadOption[] =>
downloadPlatforms.map(({ platform, label, icon, versionKey, fileNameOverride }) => { downloadPlatforms
const version = latestVersions[versionKey]; .filter(({ versionKey }) => latestVersions[versionKey] != null)
.map(({ platform, label, icon, versionKey, fileNameOverride }) => {
const version = latestVersions[versionKey]!;
const fileName = fileNameOverride ? fileNameOverride : `${platform}.zip`; const fileName = fileNameOverride ? fileNameOverride : `${platform}.zip`;

View File

@@ -1,7 +1,7 @@
export interface LatestBuildsResponse { export interface LatestBuildsResponse {
latestWindowsVersion: string; latestWindowsVersion: string | null;
latestLinuxVersion: string; latestLinuxVersion: string | null;
latestMetaVersion: string; latestMetaVersion: string | null;
} }
export interface PatchNote { export interface PatchNote {