From 85d6375faef4db378014000eb07391cbc0aaea9b Mon Sep 17 00:00:00 2001 From: everestmcarthur <280397636+everestmcarthur@users.noreply.github.com> Date: Sat, 1 Aug 2026 10:20:43 -0400 Subject: [PATCH] Add plugin directory website: searchable, filterable, generated from plugin manifests --- .github/workflows/deploy.yml | 12 +- package.json | 2 +- scripts/generate-site.mjs | 42 ++++ site/index.html | 411 +++++++++++++++++++++++++++++++++++ site/meta.json | 27 +++ 5 files changed, 483 insertions(+), 11 deletions(-) create mode 100644 scripts/generate-site.mjs create mode 100644 site/index.html create mode 100644 site/meta.json diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index cf9a4f6..b23a846 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -21,19 +21,11 @@ jobs: - name: Install deps run: npm install - - name: Build plugin(s) - run: node ./build.mjs - - - name: Copy additional files - run: | - cp README.md dist/README.md - printf -- "---\npermalink: /404.html\n---\n" > dist/404.md - printf -- "> **Note:** You accessed a link that returned a 404, probably by clicking one of the plugin links. You're supposed to copy the link address and add it into Revenge.\n\n" >> dist/404.md - cat README.md >> dist/404.md + - name: Build plugin(s) and site + run: npm run build - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./dist - enable_jekyll: true diff --git a/package.json b/package.json index 2b40680..9705096 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "revenge-plugins", "private": true, "scripts": { - "build": "node build.mjs" + "build": "node build.mjs && node scripts/generate-site.mjs" }, "dependencies": { "@swc/helpers": "^0.5.17" diff --git a/scripts/generate-site.mjs b/scripts/generate-site.mjs new file mode 100644 index 0000000..cb419fe --- /dev/null +++ b/scripts/generate-site.mjs @@ -0,0 +1,42 @@ +import { readFile, writeFile, readdir, copyFile, stat } from "fs/promises"; + +const PAGES_BASE = "https://everestmcarthur.github.io/revenge-plugins"; +const REPO_BASE = "https://github.com/everestmcarthur/revenge-plugins"; + +const meta = JSON.parse(await readFile("./site/meta.json", "utf8")); +const plugins = []; + +for (const id of await readdir("./dist")) { + const dir = `./dist/${id}`; + if (!(await stat(dir)).isDirectory()) continue; + + let manifest; + try { + manifest = JSON.parse(await readFile(`${dir}/manifest.json`, "utf8")); + } catch { + continue; // not a plugin output directory + } + + const info = meta[id] ?? {}; + + plugins.push({ + id, + name: manifest.name, + description: manifest.description, + authors: (manifest.authors ?? []).map((a) => a.name), + category: info.category ?? "Other", + status: info.status ?? "new", + note: info.note ?? "", + installUrl: `${PAGES_BASE}/${id}/`, + sourceUrl: `${REPO_BASE}/tree/main/plugins/${id}`, + issueUrl: `${REPO_BASE}/issues/new?title=${encodeURIComponent(`[${manifest.name}] `)}` + }); +} + +plugins.sort((a, b) => a.category.localeCompare(b.category) || a.name.localeCompare(b.name)); + +await writeFile("./dist/plugins-data.json", JSON.stringify(plugins, null, 2)); +await copyFile("./site/index.html", "./dist/index.html"); +await copyFile("./site/index.html", "./dist/404.html"); + +console.log(`Generated site data for ${plugins.length} plugin(s).`); diff --git a/site/index.html b/site/index.html new file mode 100644 index 0000000..8eca61a --- /dev/null +++ b/site/index.html @@ -0,0 +1,411 @@ + + +
+ + +An actively maintained collection of plugins for Revenge, the Discord Android client mod. Tap Install to copy a plugin's link, then paste it into Revenge's plugin browser.
+ + +