Skip to content

Commit

Permalink
docs: update docs site Head config
Browse files Browse the repository at this point in the history
  • Loading branch information
monospaced authored and chrisvxd committed Mar 22, 2024
1 parent 7e04767 commit 5bb1708
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 19 deletions.
Binary file added apps/docs/public/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/docs/public/favicon.ico
Binary file not shown.
Binary file removed apps/docs/public/favicon.png
Binary file not shown.
2 changes: 1 addition & 1 deletion apps/docs/public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions apps/docs/public/manifest.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "Puck",
"short_name": "Pck",
"icons": [
{
"src": "/maskable_icon_x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "/maskable_icon.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
],
"theme_color": "#111",
"background_color": "#ffffff",
"display": "standalone"
}
Binary file added apps/docs/public/maskable_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/docs/public/maskable_icon_x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/docs/public/social.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 45 additions & 18 deletions apps/docs/theme.config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,63 @@ import { Viewport } from "./components/Viewport";

const Head = () => {
const { asPath, defaultLocale, locale } = useRouter();
const config = useConfig();
const { frontMatter, title } = useConfig();

const siteUrl = "https://puckeditor.com";
const url =
"https://puckeditor.com" +
(defaultLocale === locale ? asPath : `/${locale}${asPath}`);
siteUrl + (defaultLocale === locale ? asPath : `/${locale}${asPath}`);

const defaultDescription =
"Puck empowers developers to build amazing visual editing experiences into their own React applications, powering the next generation of content tools.";
const defaultTitle = `Puck - The open-source visual editor for React`;
const description =
frontMatter.description ||
`Puck empowers developers to build amazing visual editing experiences into their own React applications, powering the next generation of content tools.`;

return (
<>
<link rel="canonical" href={`${siteUrl}${asPath}`} />
<meta property="og:url" content={url} />
<meta
property="description"
content={config.frontMatter.description || defaultDescription}
/>
<meta
property="og:description"
content={config.frontMatter.description || defaultDescription}
/>
<meta property="description" content={description} />
<meta property="og:description" content={description} />
<meta property="og:type" content="website" />
<meta property="og:image" content="https://puckeditor.com/social.png" />
<meta property="og:image" content={`${siteUrl}/social.png`} />
<meta property="og:image:height" content="675" />
<meta property="og:image:width" content="1200" />
<meta name="image" content="https://puckeditor.com/social.png" />
<meta itemProp="image" content="https://puckeditor.com/social.png" />
<meta property="og:image:alt" content="Puck" />
<meta property="og:image:type" content="image/png" />
<meta property="og:locale" content="en" />
<meta property="og:site_name" content={defaultTitle} />
<meta name="image" content={`${siteUrl}/social.png`} />
<meta itemProp="image" content={`${siteUrl}/social.png`} />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content="https://puckeditor.com/social.png" />
<meta name="twitter:image" content={`${siteUrl}/social.png`} />
<meta name="twitter:description" content={description} />
<meta name="twitter:image:alt" content="Puck" />
<meta name="twitter:image:height" content="675" />
<meta name="twitter:image:type" content="image/png" />
<meta name="twitter:image:width" content="1200" />
<meta name="twitter:site" content="@puckeditor" />
<meta
name="twitter:title"
content={title !== defaultTitle ? `${title} - Puck` : defaultTitle}
/>

<link rel="icon" href="/favicon.png" type="image/png" />
<link rel="icon" href="/favicon.ico" sizes="48x48" />
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link rel="manifest" href="/manifest.webmanifest" />
{asPath == "/" && (
<script
type="application/ld+json"
dangerouslySetInnerHTML={{
__html: `${JSON.stringify({
"@context": "https://schema.org",
"@type": "WebSite",
name: "Puck",
url: siteUrl,
})}`,
}}
/>
)}
</>
);
};
Expand Down

0 comments on commit 5bb1708

Please sign in to comment.