Skip to content

Commit bf7872c

Browse files
committed
better default meta tags
1 parent f49e910 commit bf7872c

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

packages/astro/src/default/layouts/Layout.astro

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,27 @@ import { joinPaths } from '../utils/url';
44
55
interface Props {
66
title: string;
7+
description?: string;
78
}
89
9-
const { title } = Astro.props;
10+
const { title, description = 'TutorialKit' } = Astro.props;
1011
const baseURL = import.meta.env.BASE_URL;
12+
const logoUrl = joinPaths(baseURL, '/logo.svg');
1113
---
1214

1315
<!doctype html>
1416
<html lang="en" transition:animate="none" class="h-full overflow-hidden">
1517
<head>
1618
<meta charset="UTF-8" />
17-
<meta name="description" content="TutorialKit" />
19+
<meta name="description" content={description} />
1820
<meta name="viewport" content="width=device-width" />
1921
<meta name="generator" content={Astro.generator} />
22+
<meta name="og:title" content={title} />
23+
<meta name="og:description" content={description} />
24+
<meta name="og:image" content={logoUrl} />
25+
<meta name="twitter:title" content={title} />
26+
<meta name="twitter:description" content={description} />
27+
<meta name="twitter:image" content={logoUrl} />
2028
<title>{title}</title>
2129
<link rel="icon" type="image/svg+xml" href={joinPaths(baseURL, '/favicon.svg')} />
2230
<link rel="preconnect" href="https://fonts.googleapis.com" />

packages/astro/src/default/pages/[...slug].astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type Props = InferGetStaticPropsType<typeof getStaticPaths>;
1717
const { lesson, logoLink, navList, title } = Astro.props as Props;
1818
---
1919

20-
<Layout title={title}>
20+
<Layout title={title} description="A TutorialKit interactive lesson">
2121
<PageLoadingIndicator />
2222
<div id="previews-container"></div>
2323
<main class="max-w-full flex flex-col h-full overflow-hidden" data-swap-root>

0 commit comments

Comments
 (0)