FEATURE: Add endpoint for individual SVG icons (PR #9765)

This adds an endpoint to render an SVG icon extracted from the included SVG sprites at “/svg-sprites/icon/icon-name.svg”. An optional color parameter is also available, via “/svg-sprite/icon/CC0000/icon-name.svg”.

This should allow any icons be used in PWA shortcuts menu, see https://github.com/discourse/discourse/pull/9749. cc @xfalcox

GitHub

I think this needs a :hostname parameter, since the action in the controller checks for params[:hostname]

Maybe add some cache headers? So the CDN can cache it for us. Since the icons can change between updates, I’d say a day?

1 Like