From 37fba2f6023792413ef833a7b194ea56b0d6b874 Mon Sep 17 00:00:00 2001 From: Bad Manners Date: Fri, 30 Aug 2024 17:21:52 -0300 Subject: [PATCH] Add GitGud and astro-htaccess integration --- LICENSE.md | 2 +- astro.config.mjs | 44 +++++++ package-lock.json | 17 +++ package.json | 2 + src/components/icons/brands/IconGitGud.astro | 15 +++ src/components/icons/brands/index.ts | 1 + {public => src/data}/licenses.toml | 9 +- src/layouts/BaseLayout.astro | 2 +- src/pages/[...config].ts | 54 -------- src/pages/index.astro | 85 ++++++++----- src/pages/licenses.toml.ts | 123 +++++++++++++++++++ 11 files changed, 260 insertions(+), 94 deletions(-) create mode 100644 src/components/icons/brands/IconGitGud.astro rename {public => src/data}/licenses.toml (92%) delete mode 100644 src/pages/[...config].ts create mode 100644 src/pages/licenses.toml.ts diff --git a/LICENSE.md b/LICENSE.md index 4a6478c..74e6358 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1 +1 @@ -See [public/licenses.toml](public/licenses.toml) +See [src/data/licenses.toml](src/data/licenses.toml) diff --git a/astro.config.mjs b/astro.config.mjs index d3f759b..c6a0b5a 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,5 +1,6 @@ import { defineConfig, envField } from "astro/config"; import tailwindIntegration from "@astrojs/tailwind"; +import htaccessIntegration from "astro-htaccess"; // https://astro.build/config export default defineConfig({ @@ -8,6 +9,49 @@ export default defineConfig({ tailwindIntegration({ applyBaseStyles: false, }), + htaccessIntegration({ + generateHtaccessFile: import.meta.env.APACHE_CONFIG === "true", + redirects: [ + { match: /^\/@\/(aryion|ekas?(portal)?)\b/, url: "https://aryion.com/g4/user/BadManners" }, + { match: /^\/@\/(blue[_-]?sky|bsky)\b/, url: "https://bsky.app/profile/badmanners.xyz" }, + { match: /^\/@\/(buymeacoffee|buy_me_a_coffee|buy-me-a-coffee|bmac)\b/, url: "https://www.buymeacoffee.com/BadMannersXYZ" }, + { match: /^\/@\/carrd\b/, url: "https://badmanners.carrd.co" }, + { match: /^\/@\/code[_-]?berg\b/, url: "https://codeberg.org/BadManners" }, + { match: /^\/@\/co[_-]?host\b/, url: "https://cohost.org/BadManners" }, + { match: /^\/@\/discord\b/, url: "/#discord" }, + { match: /^\/@\/e[_-]?mail\b/, url: "/#e-mail" }, + { match: /^\/@\/(fur[_-]?affinity|fa)\b/, url: "https://www.furaffinity.net/user/badmanners" }, + { match: /^\/@\/(gallery|stor(y|ies)|games?)\b/, url: "https://gallery.badmanners.xyz" }, + { match: /^\/@\/(git[_-]?hub|gh)\b/, url: "https://github.com/BadMannersXYZ" }, + { match: /^\/@\/git[_-]?lab\b/, url: "https://gitlab.com/Bad_Manners" }, + { match: /^\/@\/(git[_-]?gud|sapp?hire)\b/, url: "https://gitgud.io/BadMannersXYZ" }, + { match: /^\/@\/(google|g[_-]?mail)\b/, url: "/#gmail" }, + { match: /^\/@\/gum[_-]?road\b/, url: "https://badmanners.gumroad.com" }, + { match: /^\/@\/(ink[_-]?bunny|ib)\b/, url: "https://inkbunny.net/BadManners" }, + { match: /^\/@\/itaku\b/, url: "https://itaku.ee/profile/badmanners" }, + { match: /^\/@\/itch\b/, url: "https://bad-manners.itch.io" }, + { match: /^\/@\/keybase\b/, url: "https://keybase.io/badmanners" }, + { match: /^\/@\/keyoxide\b/, url: "https://keyoxide.org/aspe:keyoxide.org:UWYBVFCBFXTVUF2U6FS6AYJHLU" }, + { match: /^\/@\/ko[._-]?fi\b/, url: "https://ko-fi.com/badmanners" }, + { match: /^\/@\/(mastodon|meow[._-]?social|gulp[._-]?cafe)\b/, url: "https://meow.social/@BadManners" }, + { match: /^\/@\/neo[_-]?cities\b/, url: "https://badmanners.neocities.org" }, + { match: /^\/@\/picarto\b/, url: "https://www.picarto.tv/BadManners" }, + { match: /^\/@\/pillow[_-]?fort\b/, url: "https://www.pillowfort.social/BadManners" }, + { match: /^\/@\/pronouns?\b/, url: "https://pronouns.cc/@BadManners" }, + { match: /^\/@\/redd\.?it\b/, url: "https://www.reddit.com/user/BadManners_" }, + { match: /^\/@\/signal\b/, url: "https://signal.me/#eu/ytt_rk0fFmAB2JAW-x2PbUiJyc_H3kYmfL_Pq4QNh5QIDsiFtjdFHaqFRs1D36tB" }, + { match: /^\/@\/(so[_-]?furry|sf)\b/, url: "https://bad-manners.sofurry.com" }, + { match: /^\/@\/ssh\b/, url: "/ssh.pub" }, + { match: /^\/@\/steam(community|powered)?\b/, url: "https://steamcommunity.com/id/badmanners_" }, + { match: /^\/@\/subscribe[_-]?star\b/, url: "https://subscribestar.adult/bad-manners" }, + { match: /^\/@\/(telegram|t\.me)\b/, url: "https://t.me/bad_manners" }, + { match: /^\/@\/tumblr\b/, url: "https://www.tumblr.com/badmannersxyz" }, + { match: /^\/@\/twitch\b/, url: "https://www.twitch.tv/bad__manners" }, + { match: /^\/@\/weasyl\b/, url: "https://www.weasyl.com/~badmanners" }, + { match: /^\/@\/(x|twitter)\b/, url: "https://x.com/BadManners__" }, + { match: /^\/@\/(you[_-]?tube|youtu\.be|yt)\b/, url: "https://www.youtube.com/@BadMannersXYZ" }, + ], + }), ], build: { assets: "assets", diff --git a/package-lock.json b/package-lock.json index 167089f..ecb9d98 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,9 +13,11 @@ "@astrojs/rss": "^4.0.7", "@astrojs/tailwind": "^5.1.0", "astro": "^4.13.3", + "astro-htaccess": "^0.1.1", "date-fns": "^3.6.0", "tailwindcss": "^3.4.9", "tippy.js": "^6.3.7", + "toml": "^3.0.0", "typescript": "^5.5.4" }, "devDependencies": { @@ -2236,6 +2238,15 @@ "sharp": "^0.33.3" } }, + "node_modules/astro-htaccess": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/astro-htaccess/-/astro-htaccess-0.1.1.tgz", + "integrity": "sha512-GbsQZkAk62DW1CzZ5KgEuRYuZXqZXFeKt9w8MMAacmJoV5F+BfKws4x4gszpKqUi1wXSKG6psaPRPQrYIGsu0Q==", + "license": "MIT", + "peerDependencies": { + "astro": "^4.0.0" + } + }, "node_modules/autoprefixer": { "version": "10.4.18", "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.18.tgz", @@ -6430,6 +6441,12 @@ "node": ">=8.0" } }, + "node_modules/toml": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz", + "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==", + "license": "MIT" + }, "node_modules/trim-lines": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", diff --git a/package.json b/package.json index 171a3df..21dc457 100644 --- a/package.json +++ b/package.json @@ -19,9 +19,11 @@ "@astrojs/rss": "^4.0.7", "@astrojs/tailwind": "^5.1.0", "astro": "^4.13.3", + "astro-htaccess": "^0.1.1", "date-fns": "^3.6.0", "tailwindcss": "^3.4.9", "tippy.js": "^6.3.7", + "toml": "^3.0.0", "typescript": "^5.5.4" }, "devDependencies": { diff --git a/src/components/icons/brands/IconGitGud.astro b/src/components/icons/brands/IconGitGud.astro new file mode 100644 index 0000000..ed811a6 --- /dev/null +++ b/src/components/icons/brands/IconGitGud.astro @@ -0,0 +1,15 @@ +--- +import SVGIcon from "../SVGIcon.astro"; + +type Props = { + width: string; + height: string; + class?: string; +}; +--- + + + + diff --git a/src/components/icons/brands/index.ts b/src/components/icons/brands/index.ts index 83c667f..83d5a0e 100644 --- a/src/components/icons/brands/index.ts +++ b/src/components/icons/brands/index.ts @@ -4,6 +4,7 @@ export { default as IconCohost } from "./IconCohost.astro"; export { default as IconDiscord } from "./IconDiscord.astro"; export { default as IconEkasPortal } from "./IconEkasPortal.astro"; export { default as IconFurAffinity } from "./IconFurAffinity.astro"; +export { default as IconGitGud } from "./IconGitGud.astro"; export { default as IconGithub } from "./IconGithub.astro"; export { default as IconGitlab } from "./IconGitlab.astro"; export { default as IconGoogle } from "./IconGoogle.astro"; diff --git a/public/licenses.toml b/src/data/licenses.toml similarity index 92% rename from public/licenses.toml rename to src/data/licenses.toml index 36e8a5e..e7d2ee3 100644 --- a/public/licenses.toml +++ b/src/data/licenses.toml @@ -5,7 +5,7 @@ title = "badmanners.xyz" description = "Bad Manners's personal website." type = "website" date = "2023-2024" -author = "Bad Manners " +author = { name = "Bad Manners", url = "https://badmanners.xyz", email = "me@badmanners.xyz>" } source = "https://git.badmanners.xyz/badmanners/badmanners.xyz" license = { name = "MIT", url = "https://opensource.org/license/mit" } notes = "All rights reserved." @@ -45,7 +45,7 @@ source = "https://indestructibletype.com/Jost.html" license = { name = "SIL Open Font License v1.1", url = "https://opensource.org/license/ofl-1-1" } [[attributions]] -title = "Simple Icons" +author = "Simple Icons" description = "Icons for third-party brands." type = "icons" source = "https://simpleicons.org" @@ -78,13 +78,14 @@ and I'm not affiliated with any of them.""" [[attributions]] description = "Edited icons for other websites." type = "icons" -author = "Bad Manners " +author = { name = "Bad Manners", url = "https://badmanners.xyz", email = "me@badmanners.xyz>" } source = "https://git.badmanners.xyz/badmanners/badmanners.xyz/src/branch/main/src/components/icons/brands" license = { name = "CC0 1.0 Universal", url = "https://creativecommons.org/publicdomain/zero/1.0/" } items = [ "Cohost", "Eka's Portal", "Fur Affinity", + "GitGud", "Inkbunny", "Itaku", "Keyoxide", @@ -97,7 +98,7 @@ All third-party copyrights and trademarks belong to their respective owners, \ and I'm not affiliated with any of them.""" [[attributions]] -title = "Font Awesome" +author = "Font Awesome" description = "Generic icons." type = "icons" source = "https://fontawesome.com" diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index 4240fa3..9c592d2 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -73,7 +73,7 @@ const title = pageTitle ? `${pageTitle} | Bad Manners` : "Bad Manners"; >