From f57ba9ddc48bd266f4268e05ade52539c0f49232 Mon Sep 17 00:00:00 2001 From: Bad Manners Date: Mon, 26 Aug 2024 14:49:12 -0300 Subject: [PATCH] Use history.replaceState ageVerified query and remove ENABLE_VIEW_TRANSITIONS --- README.md | 7 ++--- astro.config.mjs | 1 - package-lock.json | 4 +-- package.json | 2 +- public/licenses.toml | 15 +++++++--- public/robots.txt | 2 ++ src/components/AgeRestrictedModal.astro | 8 ++---- .../AgeRestrictedScriptInline.astro | 2 +- src/components/DarkModeScript.astro | 8 ++---- src/components/DarkModeScriptInline.astro | 2 +- src/layouts/BaseLayout.astro | 17 +---------- src/pages/404.astro | 2 +- src/pages/about.astro | 10 ++----- src/pages/api/healthcheck.ts | 14 ++++++++++ src/pages/feed.xml.ts | 4 +-- src/pages/index.astro | 28 +++++++++++-------- src/pages/sam_brendan.astro | 2 +- src/pages/terms_of_service.astro | 13 +++++---- src/pages/work.astro | 24 ++++++++++++---- 19 files changed, 91 insertions(+), 74 deletions(-) create mode 100644 public/robots.txt create mode 100644 src/pages/api/healthcheck.ts diff --git a/README.md b/README.md index 8e6719f..6492680 100644 --- a/README.md +++ b/README.md @@ -29,10 +29,9 @@ npm run prettier # Prettier formatting The following optional environment variable can be set within a `.env` file: -| Name | Type | Description | -| ------------------------- | ------- | ------------------------------------------------------------------------------------------------ | -| `APACHE_CONFIG` | boolean | If set to true, generates an `.htaccess` Apache config file at the root of the output directory. | -| `ENABLE_VIEW_TRANSITIONS` | boolean | If set to true, enables Astro's View Transitions API (i.e. Single-Page App mode). | +| Name | Type | Description | +| --------------- | ------- | ------------------------------------------------------------------------------------------------ | +| `APACHE_CONFIG` | boolean | If set to true, generates an `.htaccess` Apache config file at the root of the output directory. | ### Build and deploy to remote diff --git a/astro.config.mjs b/astro.config.mjs index 987cf22..d3f759b 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -21,7 +21,6 @@ export default defineConfig({ env: { schema: { APACHE_CONFIG: envField.boolean({ context: "server", access: "public", default: false }), - ENABLE_VIEW_TRANSITIONS: envField.boolean({ context: "client", access: "public", default: false }), }, }, }, diff --git a/package-lock.json b/package-lock.json index 19612ec..3d1533a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "badmanners.xyz", - "version": "2.1.5", + "version": "2.1.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "badmanners.xyz", - "version": "2.1.5", + "version": "2.1.6", "hasInstallScript": true, "dependencies": { "@astrojs/check": "^0.9.2", diff --git a/package.json b/package.json index f8e6093..c98153e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "badmanners.xyz", "type": "module", - "version": "2.1.5", + "version": "2.1.6", "scripts": { "postinstall": "astro sync", "dev": "astro dev", diff --git a/public/licenses.toml b/public/licenses.toml index f3e9aa8..6d8599a 100644 --- a/public/licenses.toml +++ b/public/licenses.toml @@ -3,14 +3,17 @@ [copyright] title = "badmanners.xyz" description = "Bad Manners's personal website." -date = "2023–2024" +date = "2023-2024" author = "Bad Manners " source = "https://git.badmanners.xyz/badmanners/badmanners.xyz" license = { name = "MIT", url = "https://opensource.org/license/mit" } notes = "All rights reserved." -[copyright.additional] -notes = "The briefcase logo and Sam Brendan are copyrighted and tradermarked by me." +[[copyright.additional]] +notes = "The briefcase logo is copyrighted and trademarked by me. All rights reserved." + +[[copyright.additional]] +notes = "The character/fursona Sam Brendan is copyrighted and trademarked by me. All rights reserved." [[attributions]] description = "Reference sheet of Sam Brendan, a mimic x maned wolf hybrid." @@ -76,7 +79,11 @@ icons = [ "SoFurry", "SubscribeStar", ] -notes = "All third-party copyrights and trademarks belong to their respective owners." +license = { name = "CC0 1.0 Universal", url = "https://creativecommons.org/publicdomain/zero/1.0/" } +notes = """ +Original icons edited for non-commercial use. +All third-party copyrights and trademarks belong to their respective owners, \ +and I'm not affiliated with any of them.""" [[attributions]] title = "Font Awesome" diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..9624d10 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: .htaccess diff --git a/src/components/AgeRestrictedModal.astro b/src/components/AgeRestrictedModal.astro index bac730d..c4e0b0b 100644 --- a/src/components/AgeRestrictedModal.astro +++ b/src/components/AgeRestrictedModal.astro @@ -55,7 +55,6 @@ import { IconTriangleExclamation } from "./icons"; diff --git a/src/components/AgeRestrictedScriptInline.astro b/src/components/AgeRestrictedScriptInline.astro index ac1696a..31f37f2 100644 --- a/src/components/AgeRestrictedScriptInline.astro +++ b/src/components/AgeRestrictedScriptInline.astro @@ -1,4 +1,4 @@ --- --- - + diff --git a/src/components/DarkModeScript.astro b/src/components/DarkModeScript.astro index 5a8e269..95e458c 100644 --- a/src/components/DarkModeScript.astro +++ b/src/components/DarkModeScript.astro @@ -5,7 +5,6 @@ import DarkModeScriptInline from "./DarkModeScriptInline.astro"; diff --git a/src/components/DarkModeScriptInline.astro b/src/components/DarkModeScriptInline.astro index bef932d..754de0d 100644 --- a/src/components/DarkModeScriptInline.astro +++ b/src/components/DarkModeScriptInline.astro @@ -1,4 +1,4 @@ --- --- - + diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index b7e9473..4240fa3 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -1,6 +1,4 @@ --- -import { ViewTransitions } from "astro:transitions"; -import { ENABLE_VIEW_TRANSITIONS } from "astro:env/client"; import "../styles/base.css"; import "../styles/fonts.css"; import DarkModeScript from "../components/DarkModeScript.astro"; @@ -29,23 +27,10 @@ const title = pageTitle ? `${pageTitle} | Bad Manners` : "Bad Manners"; {title} - - - - {ENABLE_VIEW_TRANSITIONS ? : null} +
diff --git a/src/pages/404.astro b/src/pages/404.astro index 39396a2..82387b3 100644 --- a/src/pages/404.astro +++ b/src/pages/404.astro @@ -3,7 +3,7 @@ import BaseLayout from "../layouts/BaseLayout.astro"; --- - +

404 – Not found

diff --git a/src/pages/about.astro b/src/pages/about.astro index 21555f7..7d5b5ab 100644 --- a/src/pages/about.astro +++ b/src/pages/about.astro @@ -6,7 +6,7 @@ import { ImageSamStickerJuicebox } from "../assets/images"; --- - +

About me

@@ -64,7 +64,6 @@ import { ImageSamStickerJuicebox } from "../assets/images"; diff --git a/src/pages/api/healthcheck.ts b/src/pages/api/healthcheck.ts new file mode 100644 index 0000000..66ac46a --- /dev/null +++ b/src/pages/api/healthcheck.ts @@ -0,0 +1,14 @@ +import type { APIRoute } from "astro"; + +export type HealthcheckResponse = { + isAlive: true; +}; + +export const GET: APIRoute = () => { + if (import.meta.env.PROD) { + return new Response(null, { status: 404 }); + } + return new Response(JSON.stringify({ isAlive: !false } satisfies HealthcheckResponse), { + headers: { "Content-Type": "application/json; charset=utf-8" }, + }); +}; diff --git a/src/pages/feed.xml.ts b/src/pages/feed.xml.ts index e54b30c..082afc2 100644 --- a/src/pages/feed.xml.ts +++ b/src/pages/feed.xml.ts @@ -8,14 +8,14 @@ export const GET: APIRoute = ({ site }) => { title: "Bad Manners", description: "Bad Manners status updates", site: site!, - items: TOS_FEED.map(({ status, updatedAt }, i) => ({ + items: TOS_FEED.map(({ status, updatedAt }) => ({ title: { CLOSED: "Story commissions are closed.", OPEN: "Story commissions are open!", SEMI_OPEN: "Story commissions are semi-open, and I may accept them less frequently.", PRIVATE: "Story commissions are private; they are only open to select commissioners.", }[status], - link: i === 0 ? "https://badmanners.xyz/terms_of_service" : undefined, + link: "https://badmanners.xyz/terms_of_service", pubDate: subMinutes(dateSet(updatedAt, { hours: 12, minutes: 0, seconds: 0 }), updatedAt.getTimezoneOffset()), })), }); diff --git a/src/pages/index.astro b/src/pages/index.astro index d4fc6c4..baeb2f3 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -35,11 +35,21 @@ import { --- - + + + + +

Hi, I'm Bad Manners! @@ -618,7 +628,6 @@ import { diff --git a/src/pages/sam_brendan.astro b/src/pages/sam_brendan.astro index ebe0588..2dd4feb 100644 --- a/src/pages/sam_brendan.astro +++ b/src/pages/sam_brendan.astro @@ -6,7 +6,7 @@ import { ImageSamAllStickers, ImageSamRefsheet } from "../assets/images"; --- - +

Sam Brendan

diff --git a/src/pages/terms_of_service.astro b/src/pages/terms_of_service.astro index cbf7231..d6b344d 100644 --- a/src/pages/terms_of_service.astro +++ b/src/pages/terms_of_service.astro @@ -6,7 +6,10 @@ import { TOS_COMMISSION_STATUS, TOS_UPDATED_AT } from "../data/tos"; --- - + + + +

Terms of Service for story commissions

@@ -28,23 +31,23 @@ import { TOS_COMMISSION_STATUS, TOS_UPDATED_AT } from "../data/tos";

{ - TOS_COMMISSION_STATUS == "CLOSED" ? ( + TOS_COMMISSION_STATUS === "CLOSED" ? (

Commissions are closed.

- ) : TOS_COMMISSION_STATUS == "OPEN" ? ( + ) : TOS_COMMISSION_STATUS === "OPEN" ? (

Commissions are open.

- ) : TOS_COMMISSION_STATUS == "SEMI_OPEN" ? ( + ) : TOS_COMMISSION_STATUS === "SEMI_OPEN" ? (

Commissions are semi-open . I'll be more picky about which commissions to take.

- ) : TOS_COMMISSION_STATUS == "PRIVATE" ? ( + ) : TOS_COMMISSION_STATUS === "PRIVATE" ? (

Commissions are private diff --git a/src/pages/work.astro b/src/pages/work.astro index 9ea2d5c..240f983 100644 --- a/src/pages/work.astro +++ b/src/pages/work.astro @@ -15,7 +15,21 @@ import { SUBSCRIBESTAR_ENABLED } from "../data/subscribestar"; --- - + + + + +

My work

@@ -122,7 +136,7 @@ import { SUBSCRIBESTAR_ENABLED } from "../data/subscribestar";

Story commissions

{ - TOS_COMMISSION_STATUS == "CLOSED" ? ( + TOS_COMMISSION_STATUS === "CLOSED" ? (

My story commissions are currently closed, but regardless, feel free to{" "} @@ -130,7 +144,7 @@ import { SUBSCRIBESTAR_ENABLED } from "../data/subscribestar"; {" "} if interested.

- ) : TOS_COMMISSION_STATUS == "OPEN" ? ( + ) : TOS_COMMISSION_STATUS === "OPEN" ? (

My story commissions are currently open! Feel free to{" "} @@ -138,7 +152,7 @@ import { SUBSCRIBESTAR_ENABLED } from "../data/subscribestar"; {" "} if interested.

- ) : TOS_COMMISSION_STATUS == "SEMI_OPEN" ? ( + ) : TOS_COMMISSION_STATUS === "SEMI_OPEN" ? (

My story commissions are currently semi-open, meaning that I may take some commissions, but might reject or postpone them more easily. Feel free to{" "} @@ -147,7 +161,7 @@ import { SUBSCRIBESTAR_ENABLED } from "../data/subscribestar"; {" "} if interested.

- ) : TOS_COMMISSION_STATUS == "PRIVATE" ? ( + ) : TOS_COMMISSION_STATUS === "PRIVATE" ? (

My story commissions are currently private, meaning that I'm not offering slots publicly, but I may still work on commissions for specific clients. Regardless of whether this applies to you or not, feel free to{" "}