2020-04-24 11:41:43 -07:00
|
|
|
import * as React from "react";
|
2020-06-21 14:11:23 -07:00
|
|
|
import Head from "next/head";
|
2020-01-21 20:02:50 -07:00
|
|
|
import dynamic from "next/dynamic";
|
2020-06-12 18:50:17 -07:00
|
|
|
import Meta from "~/components/Meta";
|
2020-01-21 20:02:50 -07:00
|
|
|
import Loading from "~/components/Loading";
|
2020-04-24 11:41:43 -07:00
|
|
|
const LookingGlass = dynamic(() => import("~/components/LookingGlass"), {
|
|
|
|
loading: Loading
|
|
|
|
});
|
2020-01-19 22:03:47 -07:00
|
|
|
|
2020-06-21 14:11:23 -07:00
|
|
|
const Index = ({ faviconComponents }) => {
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<Head>
|
2020-07-27 00:41:21 -07:00
|
|
|
{faviconComponents.map(({ rel, href, type }, i) => (
|
|
|
|
<link rel={rel} href={href} type={type} key={i} />
|
|
|
|
))}
|
2020-06-21 14:11:23 -07:00
|
|
|
</Head>
|
|
|
|
<Meta />
|
|
|
|
<LookingGlass />
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export async function getStaticProps(context) {
|
2020-07-27 00:41:21 -07:00
|
|
|
const components = process.env._HYPERGLASS_FAVICONS_.map(icon => {
|
|
|
|
const { image_format, dimensions, prefix, rel } = icon;
|
|
|
|
const src = `/images/favicons/${prefix}-${dimensions[0]}x${dimensions[1]}.${image_format}`;
|
|
|
|
return { rel, href: src, type: `image/${image_format}` };
|
2020-06-21 14:11:23 -07:00
|
|
|
});
|
|
|
|
return {
|
|
|
|
props: {
|
|
|
|
faviconComponents: components
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
2020-01-17 02:50:57 -07:00
|
|
|
|
|
|
|
export default Index;
|