mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 12:05:20 +08:00
move stylesheet
This commit is contained in:
parent
c3fd34985d
commit
4175341b26
12
app/views/common/_discourse_stylesheet.html.erb
Normal file
12
app/views/common/_discourse_stylesheet.html.erb
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<%- unless SiteCustomization.override_default_style(session[:preview_style]) %>
|
||||||
|
<%=stylesheet_link_tag "application"%>
|
||||||
|
<%- end %>
|
||||||
|
|
||||||
|
<%- if mini_profiler_enabled? %>
|
||||||
|
<%- Rack::MiniProfiler.step "stylsheet" do%>
|
||||||
|
<%= stylesheet_link_tag "admin"%>
|
||||||
|
<%-end%>
|
||||||
|
<%- elsif admin? %>
|
||||||
|
<%= stylesheet_link_tag "admin"%>
|
||||||
|
<%-end%>
|
||||||
|
<%=SiteCustomization.custom_stylesheet(session[:preview_style])%>
|
31
app/views/common/_special_font_face.html.erb
Normal file
31
app/views/common/_special_font_face.html.erb
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
|
||||||
|
<%#
|
||||||
|
The fonts are loaded outside of the stylesheet so that we can dynamically change
|
||||||
|
the path. This is to get around CDN caching on the Origin:
|
||||||
|
|
||||||
|
https://forums.aws.amazon.com/thread.jspa?threadID=114646
|
||||||
|
%>
|
||||||
|
|
||||||
|
<% font_domain = "#{request.protocol}#{request.host_with_port}" %>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
@font-face {
|
||||||
|
font-family: 'FontAwesome';
|
||||||
|
src: url('<%=asset_path "fontawesome-webfont.eot" %>?<%= font_domain %>');
|
||||||
|
src: url('<%=asset_path "fontawesome-webfont.eot" %>?<%= font_domain %>#iefix') format('embedded-opentype'),
|
||||||
|
url('<%=asset_path "fontawesome-webfont.woff" %>?<%= font_domain %>') format('woff'),
|
||||||
|
url('<%=asset_path "fontawesome-webfont.ttf" %>?<%= font_domain %>') format('truetype');
|
||||||
|
font-weight: normal;
|
||||||
|
font-style: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'zocial';
|
||||||
|
src: url('/assets/zocial-regular-webfont.woff?<%= font_domain %>') format('woff'),
|
||||||
|
url('/assets/zocial-regular-webfont.ttf?<%= font_domain %>') format('truetype'),
|
||||||
|
url('/assets/zocial-regular-webfont.svg?<%= font_domain %>#zocialregular') format('svg');
|
||||||
|
font-weight: normal;
|
||||||
|
font-style: normal;
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -19,48 +19,11 @@
|
||||||
<%= javascript_include_tag "preload_store" %>
|
<%= javascript_include_tag "preload_store" %>
|
||||||
|
|
||||||
|
|
||||||
<%#
|
|
||||||
The fonts are loaded outside of the stylesheet so that we can dynamically change
|
|
||||||
the path. This is to get around CDN caching on the Origin:
|
|
||||||
|
|
||||||
https://forums.aws.amazon.com/thread.jspa?threadID=114646
|
<%= render :partial => "common/special_font_face" %>
|
||||||
%>
|
<%= render :partial => "common/discourse_stylesheet" %>
|
||||||
|
|
||||||
<%- font_domain = "#{request.protocol}#{request.host_with_port}" %>
|
|
||||||
<style>
|
|
||||||
@font-face {
|
|
||||||
font-family: 'FontAwesome';
|
|
||||||
src: url('<%=asset_path "fontawesome-webfont.eot" %>?<%= font_domain %>');
|
|
||||||
src: url('<%=asset_path "fontawesome-webfont.eot" %>?<%= font_domain %>#iefix') format('embedded-opentype'),
|
|
||||||
url('<%=asset_path "fontawesome-webfont.woff" %>?<%= font_domain %>') format('woff'),
|
|
||||||
url('<%=asset_path "fontawesome-webfont.ttf" %>?<%= font_domain %>') format('truetype');
|
|
||||||
font-weight: normal;
|
|
||||||
font-style: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
@font-face {
|
|
||||||
font-family: 'zocial';
|
|
||||||
src: url('/assets/zocial-regular-webfont.woff?<%= font_domain %>') format('woff'),
|
|
||||||
url('/assets/zocial-regular-webfont.ttf?<%= font_domain %>') format('truetype'),
|
|
||||||
url('/assets/zocial-regular-webfont.svg?<%= font_domain %>#zocialregular') format('svg');
|
|
||||||
font-weight: normal;
|
|
||||||
font-style: normal;
|
|
||||||
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<%- unless SiteCustomization.override_default_style(session[:preview_style]) %>
|
|
||||||
<%=stylesheet_link_tag "application"%>
|
|
||||||
<%- end %>
|
|
||||||
|
|
||||||
<%- if mini_profiler_enabled? %>
|
|
||||||
<%- Rack::MiniProfiler.step "stylsheet" do%>
|
|
||||||
<%= stylesheet_link_tag "admin"%>
|
|
||||||
<%-end%>
|
|
||||||
<%- elsif admin? %>
|
|
||||||
<%= stylesheet_link_tag "admin"%>
|
|
||||||
<%-end%>
|
|
||||||
<%=SiteCustomization.custom_stylesheet(session[:preview_style])%>
|
|
||||||
<%=csrf_meta_tags%>
|
<%=csrf_meta_tags%>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
@ -97,7 +60,7 @@
|
||||||
<%= yield :data %>
|
<%= yield :data %>
|
||||||
|
|
||||||
<footer id='bottom'></footer>
|
<footer id='bottom'></footer>
|
||||||
|
|
||||||
<%= render :partial => "common/discourse_javascript" %>
|
<%= render :partial => "common/discourse_javascript" %>
|
||||||
<%= render_google_analytics_code %>
|
<%= render_google_analytics_code %>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user