Skip to content

Commit a3c0e9a

Browse files
Add back missing meta tags
1 parent 083cdbf commit a3c0e9a

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

public/index.html

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,12 @@
2424
/>
2525
<meta name="theme-color" content="#673AB8" />
2626
<meta name="twitter:card" content="summary" />
27-
<!-- <meta
28-
property="og:url"
29-
content="https://preactjs.com<%= htmlWebpackPlugin.options.url %>"
30-
/> -->
31-
<!-- <meta
32-
property="og:title"
33-
content="<%= htmlWebpackPlugin.options.title %>"
34-
/> -->
35-
<!-- <meta
27+
<meta property="og:url" content="https://preactjs.com" />
28+
<meta property="og:title" content="Preact" />
29+
<meta
3630
property="og:description"
37-
content="<%= htmlWebpackPlugin.options.CLI_DATA.preRenderData.description %>"
38-
/> -->
31+
content="Preact is a fast 3kB alternative to React with the same modern API."
32+
/>
3933
<meta
4034
property="og:image"
4135
content="https://preactjs.com/assets/app-icon.png"

src/components/controllers/markdown-region.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
import EditThisPage from '../edit-button';
22
import ContentRegion from '../content-region';
3-
import { useRoute } from 'preact-iso';
3+
import { useRoute, useLocation } from 'preact-iso';
44
import { useTitle, useMeta, useTitleTemplate } from 'hoofd/preact';
55
import style from './style.module.less';
66

77
export function MarkdownRegion({ html, meta }) {
88
const { params } = useRoute();
9+
const { url } = useLocation();
910

1011
useTitleTemplate(
1112
'%s | Preact: Fast 3kb React alternative with the same ES6 API. Components & Virtual DOM.'
1213
);
1314
useTitle(meta.title);
1415
useMeta({ name: 'description', content: meta.description });
16+
useMeta({ name: 'og:description', content: meta.description });
17+
useMeta({ name: 'og:title', content: meta.title });
18+
useMeta({ name: 'og:url', content: url });
1519

1620
const showTitle = 'show_title' in meta ? !!meta.show_title : true;
1721
const canEdit = showTitle && params.name != '404';

0 commit comments

Comments
 (0)