2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-10 12:04:21 +08:00

FEATURE: Update Font Awesome to v5.4.1 and SVGs (#6557)

* First take on subsetting svg icons

* FontAwesome 5 svg subset WIP

* Include icons from plugins/badges into svg sprite subset

* add svg icon support to themes

* Add spec for SvgSprite

* Misc. SVG icon fixes

* Use FA5 svgs in local-dates plugin

* CSS adjustments, fix SVG icons in group flair

* Use SVG icons in poll plugin

* Add SVG icons to /wizard
This commit is contained in:
Penar Musaraj 2018-11-07 13:05:43 -05:00 committed by GitHub
parent 6b60646330
commit 005e1ecb9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
124 changed files with 6692 additions and 2211 deletions

View file

@ -0,0 +1,25 @@
class SvgSpriteController < ApplicationController
skip_before_action :preload_json, :redirect_to_login_if_required, :check_xhr, :verify_authenticity_token, only: [:show]
def show
no_cookies
RailsMultisite::ConnectionManagement.with_hostname(params[:hostname]) do
current_version = SvgSprite.version(SvgSprite.all_icons.to_s)
if current_version != params[:version]
return redirect_to path(SvgSprite.path)
end
svg_sprite = SvgSprite.bundle
response.headers["Last-Modified"] = 10.years.ago.httpdate
response.headers["Content-Length"] = svg_sprite.bytesize.to_s
immutable_for 1.year
render plain: svg_sprite, disposition: nil, content_type: 'image/svg+xml'
end
end
end