Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

add favicon to next js static site

1.Create a /static folder in project root. This will be added to the static export folder.
2.Add favicon file in /static folder.
3.Add _document.js to /pages/ folder according to documentation (nextjs.org) or documentation (github.com).
4.Add <link rel="shortcut icon" href="/static/favicon.ico" /> to head.
5.npm run build && npm run export
Comment

add favicon in nextjs

<Head>
    <link rel="apple-touch-icon" sizes="57x57" href="/favicons/apple-touch-icon-57x57.png" />
    <link rel="apple-touch-icon" sizes="60x60" href="/favicons/apple-touch-icon-60x60.png" />
    <link rel="apple-touch-icon" sizes="72x72" href="/favicons/apple-touch-icon-72x72.png" />
    <link rel="apple-touch-icon" sizes="76x76" href="/favicons/apple-touch-icon-76x76.png" />

    <link rel="apple-touch-icon" sizes="114x114" href="/favicons/apple-touch-icon-114x114.png" />
    <link rel="apple-touch-icon" sizes="120x120" href="/favicons/apple-touch-icon-120x120.png" />
    <link rel="apple-touch-icon" sizes="144x144" href="/favicons/apple-touch-icon-144x144.png" />
    <link rel="apple-touch-icon" sizes="152x152" href="/favicons/apple-touch-icon-152x152.png" />
    <link rel="apple-touch-icon" sizes="167x167" href="/favicons/apple-touch-icon-167x167.png" />
    <link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon-180x180.png" />

    <link rel="icon" type="image/png" sizes="16x16" href="/favicons/favicon-16x16.png" />
    <link rel="icon" type="image/png" sizes="32x32" href="/favicons/favicon-32x32.png" />
    <link rel="icon" type="image/png" sizes="96x96" href="/favicons/favicon-96x96.png" />
    <link rel="icon" type="image/png" sizes="128x128" href="/favicons/favicon-128x128.png" />
    <link rel="icon" type="image/png" sizes="196x196" href="/favicons/favicon-196x196.png" />
    <link rel="icon" type="image/png" sizes="192x192" href="/favicons/android-chrome-192x192.png" />
    <link rel="icon" type="image/png" sizes="512x512" href="/favicons/android-chrome-512x512.png" />

    <link rel="shortcut icon" href="/favicons/favicon.ico" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="mobile-web-app-capable" content="yes" />

    <meta name="msapplication-TileImage" content="/favicons/mstile-144x144.png"/>
    <meta name="msapplication-square70x70logo" content="/favicons/mstile-70x70.png"/>
    <meta name="msapplication-square150x150logo" content="/favicons/mstile-150x150.png"/>
    <meta name="msapplication-square144x144logo" content="/favicons/mstile-144x144.png"/>
    <meta name="msapplication-square310x310logo" content="/favicons/mstile-310x310.png"/>
</Head>
Comment

PREVIOUS NEXT
Code Example
Javascript :: convert the following 2 d array into 1 d array in javascript 
Javascript :: styled of styled component not working in nextjs 
Javascript :: How to download files using axios 
Javascript :: convert string to datetime javascript 
Javascript :: js make obj invisible 
Javascript :: bash parse json 
Javascript :: scrollview react native 
Javascript :: stateprovider.js react 
Javascript :: standalone form inside reactive form 
Javascript :: sending form data with fetch using js 
Javascript :: change header background color on scroll css 
Javascript :: array has object with property js 
Javascript :: js html play beep 
Javascript :: angular cli add sslkey certificate 
Javascript :: reactjs add border to the table row 
Javascript :: jest check array of string 
Javascript :: give the player an item skript 
Javascript :: faker.js lorem 
Javascript :: angular httpclient query params not working 
Javascript :: javascript local storage delete 
Javascript :: loop through object javascript 
Javascript :: handling scrolling on react router transitions 
Javascript :: js get domain 
Javascript :: javascript json string 
Javascript :: javascript excel column letter to number 
Javascript :: queryselector aria-label 
Javascript :: how to store array into react-native local storage 
Javascript :: MongooseError: Operation `users.insertOne()` buffering timed out after 10000ms node js 
Javascript :: javascript add spaces to string 
Javascript :: js window redirect 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =