feat(meta): update meta info for tag ids

This commit is contained in:
minhtrannhat 2025-02-25 20:03:01 -05:00
parent 12b48ac6fc
commit 28985cc6b7
Signed by: minhtrannhat
GPG Key ID: E13CFA85C53F8062

View File

@ -3,6 +3,7 @@ import { type Component, Show } from "solid-js";
import { posts } from "~/data/posts";
import { Posts } from "~/components/Posts";
import { tags } from "~/data/tags";
import { Title, Meta } from "@solidjs/meta";
/*
* Code from andii.dev
@ -11,6 +12,18 @@ const TagId: Component<RouteSectionProps<unknown>> = (props) => {
const tag = () => tags[props.params.id];
return (
<Show when={tag()} fallback={<div>No posts with that tag</div>}>
<Title>minhtran_dev - Tag: {tag().id}</Title>
<Meta
property="og:title"
content={`minhtran_dev Articles Tag: ${tag().id}`}
/>
<Meta property="og:description" content={`My ${tag().id} Articles`} />
<Meta property="og:image" content="/og.png" />
<Meta property="og:image:alt" content="minhtran_dev site" />
<Meta property="og:image:width" content="1200" />
<Meta property="og:image:height" content="630" />
<div>
<h1 class="text-lg font-bold mb-6">Tag: {tag().id}</h1>