@washingtonpost/site-favicons
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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;

Readme

Keywords

none

Package Sidebar

Install

npm i @washingtonpost/site-favicons

Weekly Downloads

838

Version

1.1.0

License

none

Unpacked Size

9.86 kB

Total Files

6

Last publish

Collaborators

  • tam.steph
  • wp-aberg
  • ebgranger
  • artmsilva