www/components/meta.tsx

21 lines
511 B
TypeScript
Raw Normal View History

2021-12-08 03:38:31 +00:00
import Head from 'next/head';
export default function Meta(props: { name: string, ancestors?: Array<{ name: string, path: string }> }) {
const path = () => {
if (!props.ancestors)
return props.name;
let path = '';
props.ancestors.map((obj) => {
path = `${path}${obj.name} /`;
});
return `${path} ${props.name}`;
};
return (
<Head>
<title>PaulW.XYZ / {path()}</title>
</Head>
);
}