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