diff --git a/app/routes/_frontend.$category.$slug.details/route.tsx b/app/routes/_frontend.$category.$slug.details/route.tsx index 2535495..24eb0c0 100644 --- a/app/routes/_frontend.$category.$slug.details/route.tsx +++ b/app/routes/_frontend.$category.$slug.details/route.tsx @@ -21,6 +21,8 @@ import { getBaseUrl } from "~/utils/get-base-url.server"; import { getModel } from "./query"; export const meta: MetaFunction = ({ data }) => { + const name = `${data?.currentWorkflow.title} - getactions.dev`; + return [ { title: `GitHub Actions Starter Workflows: ${data?.currentWorkflow.title} - getactions.dev`, @@ -39,7 +41,7 @@ export const meta: MetaFunction = ({ data }) => { }, { property: "og:title", - content: data?.currentWorkflow.title, + content: name, }, { property: "og:description", @@ -59,7 +61,7 @@ export const meta: MetaFunction = ({ data }) => { }, { property: "twitter:title", - content: data?.currentWorkflow.title, + content: name, }, { property: "twitter:description", diff --git a/app/routes/_frontend.$category._index/query.ts b/app/routes/_frontend.$category._index/query.ts index 385caf9..e4861dd 100644 --- a/app/routes/_frontend.$category._index/query.ts +++ b/app/routes/_frontend.$category._index/query.ts @@ -9,7 +9,7 @@ export async function getWorkflows(request: Request, category: string) { daos.map((dao) => ({ id: dao.id, name: dao.name, - category: dao.category, + category: category, title: dao.title, description: dao.description, })), diff --git a/app/routes/_frontend.$category._index/route.tsx b/app/routes/_frontend.$category._index/route.tsx index 4bca4e2..aece176 100644 --- a/app/routes/_frontend.$category._index/route.tsx +++ b/app/routes/_frontend.$category._index/route.tsx @@ -3,17 +3,65 @@ import type { LoaderFunctionArgs, MetaFunction } from "@remix-run/node"; import { Link, json, redirect, useLoaderData } from "@remix-run/react"; import { WorkflowCard } from "~/components/workflow-card"; import { WorkflowSwitcher } from "~/components/workflow-switcher"; +import { getBaseUrl } from "~/utils/get-base-url.server"; import { getWorkflows } from "./query"; export const meta: MetaFunction = ({ params, data }) => { + const name = `${data?.category?.name} Workflows - getactions.dev`; + return [ { title: `GitHub Actions Starter Workflows: ${data?.category?.name} Workflows - getactions.dev`, }, + { + name: "description", + content: data?.category?.description, + }, + { + property: "og:site_name", + content: "getactions.dev", + }, + { + property: "og:type", + content: "article", + }, + { + property: "og:title", + content: name, + }, + { + property: "og:description", + content: data?.category?.description, + }, + { + property: "og:url", + content: `${data?.baseUrl}/${data?.category?.id}`, + }, + { + property: "og:image", + content: `${data?.baseUrl}/api/${data?.category?.id}.png`, + }, + { + property: "twitter:card", + content: "summary_large_image", + }, + { + property: "twitter:title", + content: name, + }, + { + property: "twitter:description", + content: data?.category?.description, + }, + { + property: "twitter:image", + content: `${data?.baseUrl}/api/${data?.category?.id}.png`, + }, ]; }; export async function loader({ request, params }: LoaderFunctionArgs) { + const baseUrl = getBaseUrl(request); const requestedCategory = String(params.category); if (!requestedCategory) { @@ -42,7 +90,7 @@ export async function loader({ request, params }: LoaderFunctionArgs) { (category) => category.id === requestedCategory, ); - return json({ category, categories, workflows }); + return json({ baseUrl, category, categories, workflows }); } export default function Index() { diff --git a/app/routes/api.$category[.png]/model.ts b/app/routes/api.$category[.png]/model.ts index 9c58214..3150920 100644 --- a/app/routes/api.$category[.png]/model.ts +++ b/app/routes/api.$category[.png]/model.ts @@ -3,4 +3,5 @@ import { z } from "zod"; export const Model = z.object({ id: z.string(), name: z.string(), + description: z.string(), }); diff --git a/app/routes/api.$category[.png]/query.ts b/app/routes/api.$category[.png]/query.ts index d8daf48..b245e97 100644 --- a/app/routes/api.$category[.png]/query.ts +++ b/app/routes/api.$category[.png]/query.ts @@ -8,6 +8,7 @@ export async function getModel(category: string) { const model = Model.safeParse({ id: dao?.id, name: dao?.name, + description: dao?.description, }); if (!model.success) { diff --git a/app/routes/api.$category[.png]/route.ts b/app/routes/api.$category[.png]/route.ts index e17a914..ed08e87 100644 --- a/app/routes/api.$category[.png]/route.ts +++ b/app/routes/api.$category[.png]/route.ts @@ -28,8 +28,7 @@ export async function loader(args: LoaderFunctionArgs) { const resultOfGeneratingImage = await createOgImage({ title: `${model.name} Workflows`, - subtitle: - "Jumpstart your next project effortlessly without the hassle of constructing complex GitHub Actions workflows.", + subtitle: model.description, }); if (resultOfGeneratingImage.isErr()) { diff --git a/app/utils/create-og-image.server.tsx b/app/utils/create-og-image.server.tsx index 31af88f..2e30ad2 100644 --- a/app/utils/create-og-image.server.tsx +++ b/app/utils/create-og-image.server.tsx @@ -98,7 +98,7 @@ export function makeGenerateOgImage() { >
-
+

{request.title}

diff --git a/workflows/ci/category.json b/workflows/ci/category.json index 8a4cb73..9a1010e 100644 --- a/workflows/ci/category.json +++ b/workflows/ci/category.json @@ -1,4 +1,5 @@ { "id": "ci", - "name": "Continuous Integration" + "name": "Continuous Integration", + "description": "Easy to use continuous integration workflows for GitHub Actions." } diff --git a/workflows/deployment/category.json b/workflows/deployment/category.json index ee17ed5..1795ac7 100644 --- a/workflows/deployment/category.json +++ b/workflows/deployment/category.json @@ -1,4 +1,5 @@ { "id": "deployment", - "name": "Deployment" + "name": "Deployment", + "description": "Easy to use deployment workflows for GitHub Actions." } diff --git a/workflows/index.ts b/workflows/index.ts index 0599c99..d7cc207 100644 --- a/workflows/index.ts +++ b/workflows/index.ts @@ -56,6 +56,7 @@ const categories = categoryDirectories.map((categoryDirectory) => { const category = JSON.parse(contents) as Readonly<{ id: string; name: string; + description: string; }>; return category;