Clean tags with _document.js

From the start when I used Next JS, I just hated the way the tags was generated. Unorganized, with classnames and other irrelevante stuff. By extending the _document.js and _app.js I could change the default behaviour of the rendering. Every tag is now how it surposed to be. See the changes here Of cource you can hit F12 to se the result directly.

<React.Fragment>
    <Head>
        <meta charSet="utf-8" />
        {props.meta.title && <title>{props.meta.title}</title>}
        {props.meta.description && <meta name="description" 
            content={props.meta.description} />}
        <meta name="keywords" content={keywords()} />
    </Head>
<React.Fragment>

Created by Bootproject editor on 2019-08-13


  • multi

    About

    The Swede(me), Rickard Magnusson a Senior Software Engineer, currently employeed as a freelance consultant in Norway.

  • Legal

    Bootproject.se and Footer.se is property of Bootproject and may be used under (MIT)licence . See project on Bitbucket

  • Logo Contact

    Email: bootproject@icloud.com

(©) Copyright www.bootproject.no 2020