Add some meta to the site for mastodon, and remove the style tag.

This commit is contained in:
Dave Smith-Hayes 2024-08-12 21:08:20 -04:00
parent 046830730c
commit 7f5aac05c4
4 changed files with 12 additions and 1 deletions

View File

@ -23,6 +23,7 @@ app.get("/", async (c) => {
return c.render(<Home posts={postList} />, { return c.render(<Home posts={postList} />, {
meta: { meta: {
description: "The blog for Dave Smith-Hayes, a dad and developer.", description: "The blog for Dave Smith-Hayes, a dad and developer.",
mastodonUrl: "https://hachyderm.io/@davesh"
}, },
}); });
}); });

View File

@ -4,4 +4,5 @@ export type SiteMeta = {
author?: string, author?: string,
viewport?: string, viewport?: string,
title?: string, title?: string,
mastodonUrl?: string,
}; };

View File

@ -16,7 +16,6 @@ export function Page({ children, meta }: { children: any, meta: SiteMeta }) {
<head> <head>
<title>{ getPageTitle(meta.title) }davesmithhayes.com</title> <title>{ getPageTitle(meta.title) }davesmithhayes.com</title>
<MetaTags meta={meta} /> <MetaTags meta={meta} />
<Style />
<link rel="stylesheet" href="/static/main.css" /> <link rel="stylesheet" href="/static/main.css" />
<link rel="stylesheet" href="/static/intellij-light.min.css" /> <link rel="stylesheet" href="/static/intellij-light.min.css" />
</head> </head>

View File

@ -36,6 +36,16 @@ export function ViewPort({ meta }: { meta: SiteMeta }) {
return (<meta name="viewport" content={meta.viewport} />); return (<meta name="viewport" content={meta.viewport} />);
} }
export function MeRel({ meta }: { meta: SiteMeta }) {
if (!meta?.mastodonUrl) {
return (
<></>
);
}
return (<link rel="me" href={meta.mastodonUrl} />);
}
export function MetaTags({ meta }: { meta: SiteMeta }) { export function MetaTags({ meta }: { meta: SiteMeta }) {
return ( return (
<> <>