Place your favicon file in the static/ directory at your project root. Zorto copies everything in static/ to public/ at build time, so static/favicon.svg becomes /favicon.svg.

Configure in config.toml #

[extra]
favicon = "/favicon.svg"
favicon_mimetype = "image/svg+xml"

The built-in themes read config.extra.favicon and config.extra.favicon_mimetype in the <head> of base.html:

<link rel="icon" type="{{ config.extra.favicon_mimetype | default(value="image/png") }}" href="{{ config.extra.favicon }}">

If config.extra.favicon is not set, no <link rel="icon"> tag is rendered.

Supported formats #

Use any format your target browsers support. Common choices:

FileMimetype
favicon.pngimage/png
favicon.icoimage/x-icon
favicon.svgimage/svg+xml

SVG is the most flexible option — it scales to any size and supports dark mode via CSS media queries.