diff --git a/apps/website/src/lib/download-helper.ts b/apps/website/src/lib/download-helper.ts index 0f9642876..f2c8bc166 100644 --- a/apps/website/src/lib/download-helper.ts +++ b/apps/website/src/lib/download-helper.ts @@ -1,10 +1,10 @@ import rootPackageJson from '../../../../package.json'; -type App = "desktop"; +type App = "desktop" | "server"; export type Architecture = 'x64' | 'arm64'; -export type Platform = 'mac' | 'windows' | 'linux'; +export type Platform = 'macos' | 'windows' | 'linux'; let version = rootPackageJson.version; @@ -12,10 +12,15 @@ export function buildDesktopDownloadUrl(platform: Platform, format: string, arch return `https://github.com/TriliumNext/Notes/releases/download/${version}/TriliumNextNotes-${version}-${platform}-${architecture}.${format}`; } -interface DownloadMatrixEntry { - title: Record; - description: Record; - downloads: Record; +export interface DownloadInfo { + recommended?: boolean; + name: string; +} + +export interface DownloadMatrixEntry { + title: Record | string; + description: Record | string; + downloads: Record; } type DownloadMatrix = Record>; @@ -86,6 +91,24 @@ export const downloadMatrix: DownloadMatrix = { } } } + }, + server: { + linux: { + title: "Self-hosted (Linux)", + description: "Deploy Trilium Notes on your own server or VPS, compatible with most Linux distributions.", + downloads: { + docker: { + recommended: true, + name: "View on Docker Hub" + }, + tarX64: { + name: "x86 (.tar.xz)" + }, + tarArm64: { + name: "ARM (.tar.xz)" + }, + } + } } }; diff --git a/apps/website/src/routes/download/+page.svelte b/apps/website/src/routes/download/+page.svelte index 4cf09f2a8..f0d1dd578 100644 --- a/apps/website/src/routes/download/+page.svelte +++ b/apps/website/src/routes/download/+page.svelte @@ -1,6 +1,7 @@ + +
+

{typeof platform.title === "object" ? platform.title[architecture] : platform.title}

+

{typeof platform.title === "object" ? platform.description[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} +
+
+
\ No newline at end of file