Skip to content

Commit

Permalink
Add back missing meta tags
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinhagemeister committed Sep 5, 2021
1 parent 083cdbf commit a3c0e9a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
16 changes: 5 additions & 11 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,12 @@
/>
<meta name="theme-color" content="#673AB8" />
<meta name="twitter:card" content="summary" />
<!-- <meta
property="og:url"
content="https://preactjs.com<%= htmlWebpackPlugin.options.url %>"
/> -->
<!-- <meta
property="og:title"
content="<%= htmlWebpackPlugin.options.title %>"
/> -->
<!-- <meta
<meta property="og:url" content="https://preactjs.com" />
<meta property="og:title" content="Preact" />
<meta
property="og:description"
content="<%= htmlWebpackPlugin.options.CLI_DATA.preRenderData.description %>"
/> -->
content="Preact is a fast 3kB alternative to React with the same modern API."
/>
<meta
property="og:image"
content="https://preactjs.com/assets/app-icon.png"
Expand Down
6 changes: 5 additions & 1 deletion src/components/controllers/markdown-region.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import EditThisPage from '../edit-button';
import ContentRegion from '../content-region';
import { useRoute } from 'preact-iso';
import { useRoute, useLocation } from 'preact-iso';
import { useTitle, useMeta, useTitleTemplate } from 'hoofd/preact';
import style from './style.module.less';

export function MarkdownRegion({ html, meta }) {
const { params } = useRoute();
const { url } = useLocation();

useTitleTemplate(
'%s | Preact: Fast 3kb React alternative with the same ES6 API. Components & Virtual DOM.'
);
useTitle(meta.title);
useMeta({ name: 'description', content: meta.description });
useMeta({ name: 'og:description', content: meta.description });
useMeta({ name: 'og:title', content: meta.title });
useMeta({ name: 'og:url', content: url });

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

0 comments on commit a3c0e9a

Please sign in to comment.