Icons
The Lucide icon set behind one template tag and one cached sprite.
On this page
Use
An icon is a <use> of one cached sprite, so a page with fifty icons costs one request, shared by every page and kept by the browser.
{icon('arrow-right', 'size-5')}
{icon('arrow-right', 'size-5', inline: true)}
inline: true returns the SVG itself, for emails and anywhere <use> cannot reach.
Override or add an icon
Put {name}.svg in site/views/@icons/. It wins over the shipped icon of the same name, and a name the set does not have becomes a new icon. Names are lowercase letters, digits and hyphens.
The sprite
data/cache/icons/sprite.svg holds only the icons the site has drawn. Rendering an icon the sprite does not have, or whose file changed, rebuilds it and changes the ?v= in the URL, so browsers keep the old copy until there is something new. phlat cache:clear empties it and it fills again as pages render.
The icons page must stay published and hidden: it serves /icons/sprite.