mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 14:17:57 +08:00
DEV: Change method used to reference custom font assets (#13446)
The `asset-url` helper has been deprecated.
This commit is contained in:
@ -213,8 +213,9 @@ module Stylesheet
|
||||
contents = +""
|
||||
|
||||
if font[:variants].present?
|
||||
fonts_dir = UrlHelper.absolute("#{Discourse.base_path}/fonts")
|
||||
font[:variants].each do |variant|
|
||||
src = variant[:src] ? variant[:src] : "asset-url(\"/fonts/#{variant[:filename]}?v=#{DiscourseFonts::VERSION}\") format(\"#{variant[:format]}\")"
|
||||
src = variant[:src] ? variant[:src] : "url(\"#{fonts_dir}/#{variant[:filename]}?v=#{DiscourseFonts::VERSION}\") format(\"#{variant[:format]}\")"
|
||||
contents << <<~EOF
|
||||
@font-face {
|
||||
font-family: #{font[:name]};
|
||||
|
Reference in New Issue
Block a user