diff --git a/.github/workflows/build-extensions.yml b/.github/workflows/build-extensions.yml index bf25b13..5885ba6 100644 --- a/.github/workflows/build-extensions.yml +++ b/.github/workflows/build-extensions.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: - site: [furbooru, derpibooru] + site: [furbooru, derpibooru, tantabus] steps: - name: Checkout repository @@ -27,10 +27,10 @@ jobs: - name: Build extension for ${{ matrix.site }} run: | - if [ "${{ matrix.site }}" = "derpibooru" ]; then - npm run build:derpibooru - else + if [ "${{ matrix.site }}" = "furbooru" ]; then npm run build + else + npm run build:${{ matrix.site }} fi - name: Create extension zip diff --git a/.vite/pack-extension.js b/.vite/pack-extension.js index d264e9f..a5cf79d 100644 --- a/.vite/pack-extension.js +++ b/.vite/pack-extension.js @@ -67,13 +67,24 @@ export async function packExtension(settings) { return entry; }) - if (process.env.SITE === 'derpibooru') { - manifest.replaceHostTo([ - 'derpibooru.org', - 'trixiebooru.org' - ]); - manifest.replaceBooruNameWith('Derpibooru'); - manifest.setGeckoIdentifier('derpibooru-tagging-assistant@thecore.city'); + switch (process.env.SITE) { + case 'derpibooru': + manifest.replaceHostTo([ + 'derpibooru.org', + 'trixiebooru.org' + ]); + manifest.replaceBooruNameWith('Derpibooru'); + manifest.setGeckoIdentifier('derpibooru-tagging-assistant@thecore.city'); + break; + + case 'tantabus': + manifest.replaceHostTo('tantabus.ai'); + manifest.replaceBooruNameWith('Tantabus'); + manifest.setGeckoIdentifier('tantabus-tagging-assistant@thecore.city'); + break; + + default: + console.warn('No replacement set up for site: ' + process.env.SITE); } manifest.passVersionFromPackage(path.resolve(settings.rootDir, 'package.json')); diff --git a/README.md b/README.md index 23e8eef..ec7e55c 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Philomena Tagging Assistant -This is a browser extension written for the [Furbooru](https://furbooru.org) and [Derpibooru](https://derpibooru.org) -image-boards. It gives you the ability to manually go over the list of images and apply tags to them without opening -each individual image. +This is a browser extension written for the [Furbooru](https://furbooru.org), [Derpibooru](https://derpibooru.org) and +[Tantabus](https://tantabus.ai) image-boards. It gives you the ability to manually go over the list of images and apply +tags to them without opening each individual image. ## Installation @@ -59,14 +59,17 @@ npm install --save-dev Second, you need to run the `build` command. It will first build the popup using SvelteKit and then build all the content scripts/stylesheets and copy the manifest afterward. -Extension can currently be built for 2 different imageboards using one of the following commands: +Extension can currently be built for multiple different imageboards using one of the following commands: ```shell -# To build the extension for Furbooru, use: +# Furbooru: npm run build -# To build the extension for Derpbooru, use: +# Derpibooru: npm run build:derpibooru + +# Tantabus: +npm run build:tantabus ``` When build is complete, extension files can be found in the `/build` directory. These files can be either used diff --git a/package.json b/package.json index 9263983..c8d50df 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "scripts": { "build": "npm run build:popup && npm run build:extension", "build:derpibooru": "cross-env SITE=derpibooru npm run build", + "build:tantabus": "cross-env SITE=tantabus npm run build", "build:popup": "vite build", "build:extension": "node build-extension.js", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", diff --git a/src/routes/about/+page.svelte b/src/routes/about/+page.svelte index 525d24f..b56fcfd 100644 --- a/src/routes/about/+page.svelte +++ b/src/routes/about/+page.svelte @@ -11,6 +11,10 @@ if (__CURRENT_SITE__ === 'derpibooru') { currentSiteUrl = 'https://derpibooru.org'; } + + if (__CURRENT_SITE__ === 'tantabus') { + currentSiteUrl = 'https://tantabus.ai'; + }