@washingtonpost/site-favicons
v1.1.0
Published
small icon to help people find our page faster
Downloads
4,102
Keywords
Readme
Favicon
Favicons are managed here: https://github.com/WPMedia/origin-combined.
How to Use
Disclaimer:
title
,meta
or any other elements (e.g.script
) need to be contained as direct children of the Head element, or wrapped into maximum one level of <React.Fragment> or arrays—otherwise the tags won't be correctly picked up on client-side navigations.
import React from "react";
import getConfig from "next/config";
import Document, { Html, Head, Main, NextScript } from "next/document";
// Nice import here!
import { Favicon } from "@washingtonpost/site-favicons";
class ExampleDocument extends Document {
static async getInitialProps(ctx) {
const initialProps = await Document.getInitialProps(ctx);
return {
...initialProps
};
}
render() {
return (
<Html>
<Head>
<Favicon />
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
);
}
}
export default ExampleDocument;