mirror of
https://github.com/estruyf/vscode-front-matter.git
synced 2026-08-07 01:13:08 +02:00
Docs site added
This commit is contained in:
@@ -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>
|
||||
);
|
||||
};
|
||||
@@ -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>
|
||||
);
|
||||
};
|
||||
@@ -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>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
export * from './Description';
|
||||
export * from './OtherMeta';
|
||||
export * from './Title';
|
||||
Reference in New Issue
Block a user