+
{alphaVersion}
+ {!isAlphaActive && fallbackContent && (
+
+
Alpha downloads are currently unavailable.
+
{fallbackContent.description}
+
+ {fallbackContent.ctaLabel}
+
+
+
+ )}
+
The purpose of this alpha build is to test the core features of
Audacity 4 on a wide selection of hardware and operating systems.
@@ -113,37 +184,50 @@ const { win, mac, lin } = betaReleases;
class="row-start-2 sm:row-start-1 col-start-2 col-span-10 sm:col-start-8 sm:col-span-4"
>
Download links
-
- Coming soon...
-
+ ) : (
+ fallbackContent && (
+
+ )
+ )}
-
+
+
diff --git a/src/pages/beta.astro b/src/pages/beta.astro
index 8493d6c..721c866 100644
--- a/src/pages/beta.astro
+++ b/src/pages/beta.astro
@@ -1,26 +1,99 @@
---
import BaseLayout from "../layouts/BaseLayout.astro";
import "../styles/icons.css";
-import { betaReleases } from "../assets/data/betaReleases";
+import {
+ hasDownloadAssets,
+ alphaPreRelease,
+ betaPreRelease,
+ preReleaseList,
+} from "../assets/data/audacityReleases";
import SplitDownloadButton from "../components/button/SplitDownloadButton.jsx";
-const { win, mac, lin } = betaReleases;
+const betaRelease = betaPreRelease;
+
+if (!betaRelease) {
+ throw new Error("Beta campaign is not configured.");
+}
+
+const betaDownloads = betaRelease.downloads;
+const betaWindowsDownloads = betaDownloads?.win ?? [];
+const betaMacDownloads = betaDownloads?.mac ?? [];
+const betaLinuxDownloads = betaDownloads?.lin ?? [];
+const betaVersion = betaRelease.downloads.version;
+const betaKey = betaRelease.id;
+
+const isBetaActive = betaRelease.status === "active";
+const alphaRelease = alphaPreRelease;
+const isAlphaActive = Boolean(alphaRelease && alphaRelease.status === "active");
+
+const pageTitle = isBetaActive
+ ? "Audacity ® | Beta download"
+ : "Audacity ® | Pre-release availability";
+const pageDescription = isBetaActive
+ ? `Test the latest ${betaVersion} for Windows, macOS and Linux`
+ : "There are no beta builds available right now.";
+
+let fallbackContent: {
+ heading: string;
+ message: string;
+ ctaHref: string;
+ ctaLabel: string;
+} | null = null;
+
+if (!isBetaActive) {
+ const alternateActive = preReleaseList.find((entry) => {
+ if (entry.status !== "active") {
+ return false;
+ }
+
+ if (!hasDownloadAssets(entry.downloads)) {
+ return false;
+ }
+
+ return entry.id !== betaKey;
+ });
+
+ if (alternateActive) {
+ fallbackContent = {
+ heading: `${alternateActive.label} builds available`,
+ message: `We are currently sharing ${alternateActive.label.toLowerCase()} builds instead of beta releases.`,
+ ctaHref: alternateActive.pageHref,
+ ctaLabel: `Go to ${alternateActive.label.toLowerCase()} downloads`,
+ };
+ } else {
+ fallbackContent = {
+ heading: "No pre-release builds available",
+ message: "Check back soon or download the latest stable version of Audacity.",
+ ctaHref: "/download",
+ ctaLabel: "Browse stable downloads",
+ };
+ }
+}
---
-
Audacity Beta releases
+
{isBetaActive ? betaVersion : "Audacity beta releases"}
-
- There currently is no beta release available. You
- can download an pre-alpha version instead.
-
+ {isBetaActive ? (
+
+ Download the latest beta build and help us test upcoming
+ Audacity features.
+
+ ) : (
+
+ There currently is no beta release available.
+ {" "}
+ Check out the options below to stay up to date.
+
+ )}
If you'd like to help us with testing, instructions can be found
below.
@@ -40,26 +113,76 @@ const { win, mac, lin } = betaReleases;
- Audacity 4 alpha
-
-
- The Audacity 4 alpha versions are unfinished at this time. This means that some buttons may not do anything yet, or placeholder
- items be used. For details, check the alpha 1 page.
-
+ )}
diff --git a/src/pages/download.astro b/src/pages/download.astro
index 1343005..f4f6779 100644
--- a/src/pages/download.astro
+++ b/src/pages/download.astro
@@ -2,14 +2,40 @@
import BaseLayout from "../layouts/BaseLayout.astro";
import OperatingSystemCard from "../components/card/OperatingSystemCard";
import "../styles/icons.css";
-import { audacityReleases } from "../assets/data/audacityReleases";
+import {
+ audacityReleases,
+ hasDownloadAssets,
+ preReleaseList,
+ type PreReleaseEntry,
+} from "../assets/data/audacityReleases";
import ChecksumAccordion from "../components/accordion/ChecksumAccordion";
-const { version, src } = audacityReleases;
+const { version } = audacityReleases;
+const sourceDownloads = audacityReleases.src ?? [];
+const primarySourceDownload = sourceDownloads[0] ?? null;
+const activeDownloadEntries = preReleaseList.filter(
+ (entry) => entry.status === "active" && hasDownloadAssets(entry.downloads),
+);
+const hasDownloadCampaigns = activeDownloadEntries.length > 0;
+
+const formatCampaignLinkLabel = (
+ entry: PreReleaseEntry,
+ platform: string,
+ buildName?: string,
+) =>
+ `${entry.downloads.version} for ${platform}${
+ buildName ? ` (${buildName})` : ""
+ }`;
---
-