Skip to content

🎥 Make videos programmatically with React

improve SEO

Jonny Burger52753846b089
diff --git a/packages/docs/docusaurus.config.js b/packages/docs/docusaurus.config.js
index d68d710183..e44b46215d 100644
--- a/packages/docs/docusaurus.config.js
+++ b/packages/docs/docusaurus.config.js
@@ -1,7 +1,7 @@
module.exports = {
title: "Remotion | Make videos programmatically",
tagline: "Make videos programmatically",
- url: "https://remotion.dev",
+ url: "https://www.remotion.dev",
baseUrl: "/",
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "warn",
diff --git a/packages/docs/src/components/ExpertPage.tsx b/packages/docs/src/components/ExpertPage.tsx
index fa32afd134..dc171dd3df 100644
--- a/packages/docs/src/components/ExpertPage.tsx
+++ b/packages/docs/src/components/ExpertPage.tsx
@@ -8,6 +8,7 @@ import { Spacer } from "../../components/layout/Spacer";
import { experts } from "../data/experts";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
+import { Seo } from "./Seo";
const layout: React.CSSProperties = {
maxWidth: 900,
@@ -82,9 +83,9 @@ const socialIconContainer: React.CSSProperties = {
};
const socialLink: React.CSSProperties = {
- display: 'block',
- maxWidth: 'fit-content',
-}
+ display: "block",
+ maxWidth: "fit-content",
+};
const socialRow: React.CSSProperties = {
flexDirection: "row",
@@ -129,12 +130,9 @@ export default () => {
return (
<Layout>
<Head>
- <title>{expert.name} | Remotion Experts</title>
- <meta
- name="description"
- content={`Hire ${expert.name} and other Remotion experts, vetted by Remotion.`}
- />
- <meta property="og:image" content={imgSrc} />
+ <Seo.Title>{`${expert.name} | Remotion Experts`}</Seo.Title>
+ <Seo.Description>{`Hire ${expert.name} and other Remotion experts, vetted by Remotion.`}</Seo.Description>
+ <Seo.Image>{imgSrc}</Seo.Image>
</Head>
<div style={header}>
<div style={layout}>
@@ -195,7 +193,11 @@ export default () => {
</div>
</a>
{expert.github ? (
- <a style={socialLink} href={`https://github.com/${expert.github}`} target={"_blank"}>
+ <a
+ style={socialLink}
+ href={`https://github.com/${expert.github}`}
+ target={"_blank"}
+ >
<div style={socialRow}>
<div style={socialIconContainer}>
<svg
@@ -214,7 +216,11 @@ export default () => {
</a>
) : null}
{expert.twitter ? (
- <a style={socialLink} href={`https://twitter.com/${expert.twitter}`} target={"_blank"}>
+ <a
+ style={socialLink}
+ href={`https://twitter.com/${expert.twitter}`}
+ target={"_blank"}
+ >
<div style={socialRow}>
<div style={socialIconContainer}>
<svg
@@ -233,7 +239,11 @@ export default () => {
</a>
) : null}
{expert.linkedin ? (
- <a style={socialLink} href={`https://linkedin.com/${expert.linkedin}`} target={"_blank"}>
+ <a
+ style={socialLink}
+ href={`https://linkedin.com/${expert.linkedin}`}
+ target={"_blank"}
+ >
<div style={socialRow}>
<div style={socialIconContainer}>
<svg
diff --git a/packages/docs/src/components/Seo.tsx b/packages/docs/src/components/Seo.tsx
new file mode 100644
index 0000000000..ef20498f79
--- /dev/null
+++ b/packages/docs/src/components/Seo.tsx
@@ -0,0 +1,33 @@
+import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
+import React from "react";
+
+export const Seo = {
+ Title: ({ children }: { children: string }) => {
+ return (
+ <>
+ <title>{children}</title>
+ <meta property="og:title" content={children} />
+ </>
+ );
+ },
+ Description: ({ children }: { children: string }) => {
+ return (
+ <>
+ <meta name="description" content={children} />
+ <meta property="og:description" content={children} />
+ </>
+ );
+ },
+ Image: ({ children }: { children: string }) => {
+ const context = useDocusaurusContext();
+
+ const imgSrc = new URL(children, context.siteConfig.url).href;
+
+ return (
+ <>
+ <meta property="og:image" content={imgSrc} />
+ <meta name="twitter:image" content={imgSrc} />
+ </>
+ );
+ },
+};
diff --git a/packages/docs/src/pages/experts/index.tsx b/packages/docs/src/pages/experts/index.tsx
index 7adf589aeb..93762c1181 100644
--- a/packages/docs/src/pages/experts/index.tsx
+++ b/packages/docs/src/pages/experts/index.tsx
@@ -11,6 +11,7 @@ import {
LinkedInLogo,
TwitterLogo,
} from "../../components/icons";
+import { Seo } from "../../components/Seo";
import { experts } from "../../data/experts";
import styles from "./experts.module.css";
@@ -47,24 +48,12 @@ const Experts: React.FC = () => {
return (
<Layout>
<Head>
- <title>Remotion experts | Hire Remotion freelancers</title>
- <meta
- name="description"
- content="Find Remotion freelancers and hire them to create, progress or unblock your Remotion project."
- />
- <meta name="og:image" content="/img/remotion-experts-og-image.png" />
- <meta
- name="twitter:image"
- content="/img/remotion-experts-og-image.png"
- />
- <meta
- property="og:image"
- content="/img/remotion-experts-og-image.png"
- />
- <meta
- property="twitter:image"
- content="/img/remotion-experts-og-image.png"
- />
+ <Seo.Title>Remotion experts | Hire Remotion freelancers</Seo.Title>
+ <Seo.Description>
+ Find Remotion freelancers and hire them to create, progress or unblock
+ your Remotion project.
+ </Seo.Description>
+ <Seo.Image>{"/img/remotion-experts-og-image.png"}</Seo.Image>
</Head>
<div className={styles.container}>
<div className={styles.background} />