Generated package

GitBook — Self-hosted / Static Export favicon package. Ready to install.

Download the correct GitBook — Self-hosted / Static Export favicon package, place every file in the right location, and follow the exact installation steps for this stack.

Stack-specific filesExact snippet locationsCopy-ready guide
Documentation10 files

GitBook — Self-hosted / Static Export

For GitBook Legacy / HonKit static exports. The postbuild script copies files into _book and injects the head snippet.

ZIP: favico-gitbook-static-modern-package.zip

Folder: favico-gitbook-static-modern-favicon/

  1. 1
    Download your favicon package.
    Download favico-gitbook-static-modern-package.zip for GitBook — Self-hosted / Static Export.
  2. 2
    Extract this package in your project.
    Extract it in your project root. The package contains:
    Package structure
    favico-gitbook-static-modern-favicon/
    ├── favicons/favicon.ico
    ├── favicons/favicon.svg
    ├── favicons/favicon-dark.svg
    ├── favicons/favicon-96x96.png
    ├── favicons/favicon-dark-96x96.png
    ├── favicons/apple-touch-icon.png
    ├── favicons/site.webmanifest
    ├── favicons/web-app-manifest-192x192.png
    ├── favicons/web-app-manifest-512x512.png
    └── _book/gitbook/images/favicon.ico
  3. 3
    Copy the favicon files to the correct location.
    Copy the generated files to favicons/ source folder and _book/ generated output.
    Generated fileCopy toStatusPurpose
    favicon.icofavicons/favicon.icoOptionalOptional classic browser fallback file. Keep it when useful, but do not link it by default in modern light/dark favicon snippets.
    favicon.svgfavicons/favicon.svgRequiredLight-mode SVG favicon for modern browsers.
    favicon-dark.svgfavicons/favicon-dark.svgOptionalDark-mode SVG favicon used with prefers-color-scheme: dark.
    favicon-96x96.pngfavicons/favicon-96x96.pngRequiredLight-mode PNG fallback favicon.
    favicon-dark-96x96.pngfavicons/favicon-dark-96x96.pngOptionalDark-mode PNG fallback favicon.
    apple-touch-icon.pngfavicons/apple-touch-icon.pngRequirediPhone/iPad home screen icon.
    site.webmanifestfavicons/site.webmanifestRequiredWeb app manifest containing app metadata and PWA icon references.
    web-app-manifest-192x192.pngfavicons/web-app-manifest-192x192.pngRequired192×192 Android/PWA icon referenced by the web app manifest.
    web-app-manifest-512x512.pngfavicons/web-app-manifest-512x512.pngRequired512×512 Android/PWA icon referenced by the web app manifest.
    favicon.ico_book/gitbook/images/favicon.icoOptionalGitBook/HonKit fallback favicon copied by the postbuild script.
  4. 4
    Add the config snippet in package.json postbuild script.
    package.json postbuild script
    {
      "scripts": {
        "build": "honkit build",
        "postbuild": "node scripts/inject-favicons.cjs"
      }
    }
  5. 5
    Insert the favicon/head snippet in scripts/inject-favicons.cjs injects links into _book/*.html.
    scripts/inject-favicons.cjs injects links into _book/*.html
    <meta name="color-scheme" content="light dark">
    
    <link rel="icon" type="image/svg+xml" href="/favicon.svg?v=10" media="(prefers-color-scheme: light)">
    <link rel="icon" type="image/svg+xml" href="/favicon-dark.svg?v=10" media="(prefers-color-scheme: dark)">
    
    <link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png?v=10" media="(prefers-color-scheme: light)">
    <link rel="icon" type="image/png" sizes="96x96" href="/favicon-dark-96x96.png?v=10" media="(prefers-color-scheme: dark)">
    
    <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png?v=10">
    <link rel="manifest" href="/site.webmanifest?v=10">
  6. 6
    Why this setup works.
    • Static GitBook/HonKit output is generated into _book/.
    • A postbuild script is needed to copy favicons and inject links into generated HTML.
  7. Support Favico Studio

    Satisfied with the result?

    If Favico Studio helped you create your favicon faster, you can support the creator and help keep this tool free, fast, and available for everyone.

    Support the creator
  8. 7
    Start your app and verify the favicon URLs.
    Run command
    npm run build
    Verify URLs
    Serve _book/ and open /favicon.svg
    Serve _book/ and open /site.webmanifest
  9. 8
    Common mistakes to avoid.

    Using the source folder name in the browser URL

    Wrong: /public/favicon.svg or /static/favicon.svg

    Correct: /favicon.svg

    Most frameworks copy public/static assets to the website root. The browser should usually request the root URL, not the source folder name.

    Making favicon.ico the main favicon

    Wrong: <link rel="icon" href="/favicon.ico">

    Correct: Use SVG and PNG links with light/dark media queries.

    favicon.ico is included as an old-browser fallback, but actively linking it can override the modern light/dark setup.

  10. 9
    Final checklist.
    Correct stack selected.
    Correct package downloaded and extracted.
    Files copied to the exact folder shown in this guide.
    Config snippet added only when this stack requires it.
    Head/favicon snippet added to the exact head location shown in this guide.
    No /public/ or /static/ URL is used unless the framework explicitly requires it.
    favicon.ico is kept as fallback only, not actively linked as the main favicon.
    favicon.svg loads directly.
    favicon-dark.svg loads directly.
    site.webmanifest loads directly.
    Manifest icon PNG files load directly.
    Browser cache cleared and Favico Studio checker passes.