diff --git a/apps/golinks-v2/src/api/meta.ts b/apps/golinks-v2/src/api/meta.ts index 3c92130..dde83cd 100644 --- a/apps/golinks-v2/src/api/meta.ts +++ b/apps/golinks-v2/src/api/meta.ts @@ -25,7 +25,7 @@ export class CommitHash extends OpenAPIRoute { return c.json( { success: true, - return: c.env.GIT_DEPLOY_COMMIT, + result: c.env.GIT_DEPLOY_COMMIT, }, 200, ); diff --git a/apps/golinks-v2/src/lib/old-links.json b/apps/golinks-v2/src/data/old-links.json similarity index 83% rename from apps/golinks-v2/src/lib/old-links.json rename to apps/golinks-v2/src/data/old-links.json index 39a6c68..85e5e74 100644 --- a/apps/golinks-v2/src/lib/old-links.json +++ b/apps/golinks-v2/src/data/old-links.json @@ -4,8 +4,8 @@ "url": "https://useplaintext.email" }, "/substack/s/fromthebshq": { - "reason": "Deprecated substack redirect", - "url": "https://fromthebshq.substack.com" + "reason": "Deprecated substack redirect, also updating to go/substack/fromthebshq", + "url": "/substack/fromthebshq" }, "/yugipedia/discord": { "reason": "Updating golink to go/discord/yugipedia", diff --git a/apps/golinks-v2/src/pages/base.tsx b/apps/golinks-v2/src/pages/base.tsx new file mode 100644 index 0000000..adc11fd --- /dev/null +++ b/apps/golinks-v2/src/pages/base.tsx @@ -0,0 +1,74 @@ +import { css, Style } from "hono/css" +import type { FC, PropsWithChildren } from "hono/jsx" + +const styling = css` +body { + max-width: 800px; + margin: 0 auto; + font: 11pt monospace; + padding: 0 1rem; +} + +ul li { + margin: 0.5rem 0; +} + +.muted { + color: grey; +} + +pre { + max-width: 100%; + overflow-x: auto; + background: #e0e0e0; + margin: 0 -1rem; + padding: 0 1rem; +} + +pre+pre { + margin-top: 1rem; +} + +h2 a { + text-decoration: none; + color: black; +} + +.breakdown { + display: flex; + justify-content: space-between; +} + +@media(max-width: 720px) { + .breakdown { + display: block; + } + + .breakdown span { + display: block; + } +} + +.breakdown span { + padding: 0.5rem; +} +` + +type PageMetadata = { + title: string + name: string +} + +export const BaseLayout: FC = (props) => { + return( + + + {props.title} - Andrei Jiroh's golinks service + + + + {props.children} + + + ) +} diff --git a/apps/golinks-v2/src/pages/deprecated-link.tsx b/apps/golinks-v2/src/pages/deprecated-link.tsx index 9c7e5ac..7ab9dff 100644 --- a/apps/golinks-v2/src/pages/deprecated-link.tsx +++ b/apps/golinks-v2/src/pages/deprecated-link.tsx @@ -1,35 +1,25 @@ +import { css, Style } from "hono/css"; import type { FC } from "hono/jsx"; - -const Layout: FC = (props) => { - return ( - - - Deprecated golink landing page - - {props.children} - - ); -}; +import { BaseLayout } from "./base"; export const DeprecatedGoLinkPage: FC<{ - url: string; golink: string; reason: string | "We're changing things up"; }> = (props: { golink: string; reason: string | null }) => { const forceRedirect = `/${props.golink}?force_redirect=1`; - return ( - -

Deprecated golink: go/{props.golink}

- This golink is being flagged as deprecated due to the following reason: - -

- If the golink is being renamed as the reason, please update your URLs. If you still want to go there, please{" "} - click here. -

-
-

The lack of CSS is intentional to keep things simple. It will be added soon.

-
- ); + return ( + +

Deprecated golink: go/{props.golink}

+

This golink is being flagged as deprecated due to the following reason:

+ +

+ If the golink is being renamed as the reason, please update your URLs. If you still want to go there, please{" "} + click here. +

+
+

The lack of CSS is intentional to keep things simple. It will be added soon.

+
+ ) }; diff --git a/apps/golinks-v2/src/types.ts b/apps/golinks-v2/src/types.ts index 2078cc0..e34f19a 100644 --- a/apps/golinks-v2/src/types.ts +++ b/apps/golinks-v2/src/types.ts @@ -32,6 +32,7 @@ export const DiscordInvites = z.object({ export interface Env { DEPLOY_ENV: "production" | "staging" | "development"; + GIT_DEPLOY_COMMIT: string; golinks: D1Database; ADMIN_KEY: string; } @@ -40,4 +41,5 @@ export type EnvBindings = { golinks: D1Database; DEPLOY_ENV: "production" | "staging" | "development"; ADMIN_KEY: string; + GIT_DEPLOY_COMMIT: string };