From caafdd81d49c0accb26a608792c55aa20999b8c7 Mon Sep 17 00:00:00 2001 From: Justin Chung <20733699+justin13888@users.noreply.github.com> Date: Tue, 30 Jan 2024 19:31:39 -0500 Subject: [PATCH 1/2] Update README --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8783327..68cca88 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,20 @@ # Vencord Website -https://vencord.dev + + +## Development + +### Requirements + +- Node.js +- pnpm + +### Setup + +1. Clone the repository +2. Install dependencies with `pnpm install` +3. Run `pnpm dev` to start the development server + +## License + +This project is licensed under AGPL-3.0. See [LICENSE](LICENSE) for more details. From 8dc8460a4f1901ba01535d4793afbf4c175c4be8 Mon Sep 17 00:00:00 2001 From: Justin Chung <20733699+justin13888@users.noreply.github.com> Date: Tue, 30 Jan 2024 21:43:01 -0500 Subject: [PATCH 2/2] Add Vesktop to vencord.dev --- scripts/generateRedirects.mjs | 9 + src/components/AutoSizeGrid.astro | 8 +- src/components/NavBar.astro | 1 + src/components/pages/download/Tab.astro | 15 +- src/components/pages/download/index.svelte | 23 ++- .../download/{ => vencord}/BrowserTab.astro | 2 +- .../download/{ => vencord}/LinuxTab.astro | 2 +- .../pages/download/{ => vencord}/MacTab.astro | 12 +- .../download/{ => vencord}/WindowsTab.astro | 12 +- .../pages/download/vesktop/LinuxTab.astro | 35 ++++ .../pages/download/vesktop/MacTab.astro | 33 +++ .../pages/download/vesktop/WindowsTab.astro | 38 ++++ src/pages/download.astro | 40 +++- src/pages/vesktop/index.astro | 190 ++++++++++++++++++ src/scripts/constants.ts | 2 + 15 files changed, 386 insertions(+), 36 deletions(-) rename src/components/pages/download/{ => vencord}/BrowserTab.astro (98%) rename src/components/pages/download/{ => vencord}/LinuxTab.astro (95%) rename src/components/pages/download/{ => vencord}/MacTab.astro (78%) rename src/components/pages/download/{ => vencord}/WindowsTab.astro (86%) create mode 100644 src/components/pages/download/vesktop/LinuxTab.astro create mode 100644 src/components/pages/download/vesktop/MacTab.astro create mode 100644 src/components/pages/download/vesktop/WindowsTab.astro create mode 100644 src/pages/vesktop/index.astro diff --git a/scripts/generateRedirects.mjs b/scripts/generateRedirects.mjs index 069d4cf..6c0e55c 100644 --- a/scripts/generateRedirects.mjs +++ b/scripts/generateRedirects.mjs @@ -12,6 +12,14 @@ const BaseRedirects = { "/donate": "https://github.com/sponsors/Vendicated", }; +const VesktopRedirects = { + "/vesktop/github": "https://github.com/Vencord/Vesktop", + "/vesktop/discord": "https://discord.gg/D9uwnFnqmd", + "/vesktop/support": "https://discord.gg/D9uwnFnqmd", + "/vesktop/install": "/download/#vesktop", + "/vesktop/donate": "https://github.com/sponsors/Vendicated", +}; + const VesktopDownloads = version => ({ "/download/vesktop/amd64/windows": `https://github.com/Vencord/Vesktop/releases/download/v${version}/Vesktop-Setup-${version}.exe`, "/download/vesktop/amd64/windows-portable": `https://github.com/Vencord/Vesktop/releases/download/v${version}/Vesktop-${version}-win.zip`, @@ -33,6 +41,7 @@ const VesktopDownloads = version => ({ const Redirects = { ...BaseRedirects, + ...VesktopRedirects, ...VesktopDownloads( readFileSync("scripts/_latestVesktopVersion.txt", "utf-8") ), diff --git a/src/components/AutoSizeGrid.astro b/src/components/AutoSizeGrid.astro index eba0ab0..0d2ae19 100644 --- a/src/components/AutoSizeGrid.astro +++ b/src/components/AutoSizeGrid.astro @@ -10,16 +10,14 @@ export type Props = HTMLAttributes<"div">; diff --git a/src/components/NavBar.astro b/src/components/NavBar.astro index 0855a33..9fe1fe7 100644 --- a/src/components/NavBar.astro +++ b/src/components/NavBar.astro @@ -1,6 +1,7 @@ --- const navLinks = { download: ["Download", "accentPurple"], + vesktop: ["Vesktop", "accentGreen"], plugins: ["Plugins", "accentBlue"], faq: ["FAQ", "accentAqua"], cloud: ["Cloud", "accentYellow"], diff --git a/src/components/pages/download/Tab.astro b/src/components/pages/download/Tab.astro index a5b2509..0292b2b 100644 --- a/src/components/pages/download/Tab.astro +++ b/src/components/pages/download/Tab.astro @@ -1,27 +1,28 @@ --- import AutoSizeGrid from "components/AutoSizeGrid.astro"; import LinkButton from "components/LinkButton.astro"; -import { DOWNLOAD_BASE } from "scripts/constants"; + +export type NameUrlTuple = [name: string, url: string]; export interface Props { - fileNames?: string[]; + links?: NameUrlTuple[]; } -const { fileNames } = Astro.props as Props; +const { links } = Astro.props as Props; ---
{ - fileNames && fileNames.length > 0 && ( + links && links.length > 0 && ( - {fileNames.map((f, i) => ( + {links.map(([name, url], i) => ( - Download {f} + Download {name} ))} diff --git a/src/components/pages/download/index.svelte b/src/components/pages/download/index.svelte index d96b5bf..bf2b6ce 100644 --- a/src/components/pages/download/index.svelte +++ b/src/components/pages/download/index.svelte @@ -4,9 +4,13 @@ import { IS_SERVER } from "scripts/constants"; - const options = ["Windows", "Linux", "Mac", "Browser"] as const; + export let exclusions: string[] = []; // Accept exclusions as a prop + const allOptions = ["Windows", "Linux", "Mac", "Browser"] as const; - const accents: { [option in (typeof options)[number]]: string } = { + // Filter options based on exclusions + const options = allOptions.filter(option => !exclusions.includes(option)); + + const accents: { [option in (typeof allOptions)[number]]: string } = { Windows: "Blue", Linux: "Green", Mac: "Yellow", @@ -16,13 +20,16 @@ const initialValue = IS_SERVER ? "Windows" : (() => { - const stored = localStorage.platform; + const stored: any = localStorage.platform; if (stored && options.includes(stored)) return stored; const platform = navigator.platform.toLowerCase(); - if (platform.includes("linux")) return "Linux"; - if (platform.includes("mac")) return "Mac"; - return "Windows"; + if (platform.includes("linux") && !exclusions.includes("Linux")) + return "Linux"; + if (platform.includes("mac") && !exclusions.includes("Mac")) + return "Mac"; + if (!exclusions.includes("Windows")) return "Windows"; + return options[0]; // Fallback })(); const selected = writable(initialValue); @@ -31,7 +38,7 @@
-