From 45a053dfbfc9554689f421befabf1795f548938f Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 14 Jun 2025 16:26:40 +0300 Subject: [PATCH] feat(website/download): reorganize desktop downloads --- apps/website/src/lib/download-helper.ts | 11 +- apps/website/src/routes/+layout.svelte | 4 + apps/website/src/routes/+page.svelte | 6 +- apps/website/src/routes/download/+page.svelte | 147 +++++++++--------- apps/website/src/routes/header.svelte | 9 +- 5 files changed, 94 insertions(+), 83 deletions(-) diff --git a/apps/website/src/lib/download-helper.ts b/apps/website/src/lib/download-helper.ts index 0a6b478d6..ab8bdc5bf 100644 --- a/apps/website/src/lib/download-helper.ts +++ b/apps/website/src/lib/download-helper.ts @@ -10,10 +10,12 @@ export function buildDesktopDownloadUrl(platform: Platform, format: string, arch return `https://github.com/TriliumNext/Notes/releases/download/${version}/TriliumNextNotes-${version}-${platform}-${architecture}.${format}`; } +// Keep compatibility info inline with https://github.com/electron/electron/blob/main/README.md#platform-support. export const downloadMatrix = { desktop: { windows: { title: "Windows", + description: "Compatible with Windows 10 and 11.", downloads: { exe: { recommended: true, @@ -26,15 +28,17 @@ export const downloadMatrix = { }, linux: { title: "Linux", + description: "Runs on most major distributions.", downloads: { deb: { - name: "Debian/Ubuntu (.deb)" + recommended: true, + name: ".deb" }, rpm: { - name: "Red Hat-based distributions (.rpm)" + name: ".rpm" }, flatpak: { - name: "Flatpak (.flatpak)" + name: ".flatpak" }, zip: { name: "Portable (.zip)" @@ -43,6 +47,7 @@ export const downloadMatrix = { }, macos: { title: "macOS", + description: "Works on macOS Big Sur and up.", downloads: { dmg: { recommended: true, diff --git a/apps/website/src/routes/+layout.svelte b/apps/website/src/routes/+layout.svelte index 23fcd7133..f8a8cea2e 100644 --- a/apps/website/src/routes/+layout.svelte +++ b/apps/website/src/routes/+layout.svelte @@ -8,3 +8,7 @@
{@render children()} + + \ No newline at end of file diff --git a/apps/website/src/routes/+page.svelte b/apps/website/src/routes/+page.svelte index 7a3028adc..2997310c6 100644 --- a/apps/website/src/routes/+page.svelte +++ b/apps/website/src/routes/+page.svelte @@ -142,8 +142,4 @@ - - - \ No newline at end of file + \ No newline at end of file diff --git a/apps/website/src/routes/download/+page.svelte b/apps/website/src/routes/download/+page.svelte index b54d8efba..401188eba 100644 --- a/apps/website/src/routes/download/+page.svelte +++ b/apps/website/src/routes/download/+page.svelte @@ -6,81 +6,88 @@ let architecture = getArchitecture(); -
-

Desktop application

- - -
- Architecture: -
- {#each architectures as arch} - +
+
+

Download the desktop application

+ + +
+ Architecture: +
+ {#each architectures as arch} + + {/each} +
+
+ +
+ {#each Object.entries(downloadMatrix.desktop) as [platformId, platform]} + {@const recommended = Object.entries(platform.downloads).find((e) => e[1].recommended)} + {@const textColor = (platformId === "windows" ? "text-blue-600" : platformId === "linux" ? "text-violet-600" : "text-gray-800")} + {@const bgColor = (platformId === "windows" ? "bg-blue-600" : platformId === "linux" ? "bg-violet-600" : "bg-gray-800")} + {@const hoverColor = (platformId === "windows" ? "hover:bg-blue-700" : platformId === "linux" ? "hover:bg-violet-700" : "hover:bg-gray-900")} + +
+

{platform.title} ({architecture})

+

{platform.description}

+
+ {#if recommended} + + Download {recommended[1].name} + + {/if} +
+ {#each Object.entries(platform.downloads).filter((e) => !e[1].recommended) as [format, download]} + + {download.name} + + {/each} +
+
+
{/each}
-
+
-
- {#each Object.entries(downloadMatrix.desktop) as [platformId, platform]} -
-
-

{platform.title} ({architecture})

- - + -
-

Server

- -
+
diff --git a/apps/website/src/routes/header.svelte b/apps/website/src/routes/header.svelte index 170b67765..b018556c4 100644 --- a/apps/website/src/routes/header.svelte +++ b/apps/website/src/routes/header.svelte @@ -2,7 +2,7 @@ import DownloadNow from "./download-now.svelte"; -
+