add opengraph tags
This commit is contained in:
BIN
src/assets/img/logo-512.webp
Normal file
BIN
src/assets/img/logo-512.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
@ -1,16 +1,18 @@
|
||||
---
|
||||
import { ClientRouter } from 'astro:transitions';
|
||||
import { BASE_PATH } from 'astro:env/server';
|
||||
import logo512 from '../assets/img/logo-512.png';
|
||||
import favicon from '../assets/favicon.png';
|
||||
|
||||
interface Props {
|
||||
title: string;
|
||||
description?: string;
|
||||
keywords?: string[];
|
||||
openGraph?: boolean;
|
||||
viewTransition?: boolean;
|
||||
}
|
||||
|
||||
const { title, description, keywords, viewTransition } = Astro.props;
|
||||
const { title, description, keywords, openGraph, viewTransition } = Astro.props;
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
@ -21,7 +23,12 @@ const { title, description, keywords, viewTransition } = Astro.props;
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<link rel="icon" type="image/png" href={favicon.src} />
|
||||
<title>{title}</title>
|
||||
{openGraph && (
|
||||
<meta name="og:title" content={title} />
|
||||
<meta property="og:url" content={Astro.url.pathname} />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:image" content={logo512.src} />
|
||||
)}
|
||||
<meta name="description" content={description} />
|
||||
{keywords && <meta name="keywords" content={keywords.join(', ')} />}
|
||||
<base href=`${BASE_PATH}/` />
|
||||
|
@ -14,7 +14,7 @@ interface Props {
|
||||
const { title, description, footer = true } = Astro.props;
|
||||
---
|
||||
|
||||
<BaseLayout title={title} description={description} viewTransition>
|
||||
<BaseLayout title={title} description={description} openGraph={true} viewTransition>
|
||||
<main class="min-h-[calc(100vh-3.5rem)] h-full w-full relative">
|
||||
<slot />
|
||||
</main>
|
||||
|
Reference in New Issue
Block a user