Docs site added

This commit is contained in:
Elio Struyf
2021-08-30 15:13:06 +02:00
parent 39d3cf46f3
commit 94a8610edf
62 changed files with 2086 additions and 25 deletions
+16
View File
@@ -0,0 +1,16 @@
import Head from 'next/head';
import * as React from 'react';
export interface IDescriptionProps {
value: string;
}
export const Description: React.FunctionComponent<IDescriptionProps> = ({value}: React.PropsWithChildren<IDescriptionProps>) => {
return (
<Head>
<meta name="description" content={value} />
<meta property="og:description" content={value} />
<meta property="twitter:description" content={value} />
</Head>
);
};
+28
View File
@@ -0,0 +1,28 @@
import Head from 'next/head';
import { useRouter } from 'next/router';
import * as React from 'react';
import { publicUrl } from '../../lib/publicUrl';
export interface IOtherMetaProps {
image: string;
type?: "website" | "article";
}
export const OtherMeta: React.FunctionComponent<IOtherMetaProps> = ({ image, type }: React.PropsWithChildren<IOtherMetaProps>) => {
const router = useRouter();
return (
<Head>
<link rel="canonical" href={`${publicUrl()}${router?.asPath || ""}`} />
<meta property="og:type" content={type || "website"} />
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content={`${publicUrl()}${router?.asPath || ""}`} />
<meta property="og:url" content={`${publicUrl()}${router?.asPath || ""}`} />
<meta property="og:image" content={`${publicUrl()}/${image}`} />
<meta property="twitter:image" content={`${publicUrl()}/${image}`} />
</Head>
);
};
+18
View File
@@ -0,0 +1,18 @@
import * as React from 'react';
import Head from 'next/head';
import { Extension } from '../../constants/extension';
export interface ITitleProps {
value: string;
}
export const Title: React.FunctionComponent<ITitleProps> = ({value}: React.PropsWithChildren<ITitleProps>) => {
return (
<Head>
<title>{value} | {Extension.name}</title>
<meta name="title" content={`${value} | ${Extension.name}`} />
<meta property="og:title" content={`${value} | ${Extension.name}`} />
<meta property="twitter:title" content={`${value} | ${Extension.name}`} />
</Head>
);
};
+3
View File
@@ -0,0 +1,3 @@
export * from './Description';
export * from './OtherMeta';
export * from './Title';