move stylesheet

This commit is contained in:
xdite 2013-02-11 19:41:23 +08:00
parent c3fd34985d
commit 4175341b26
3 changed files with 46 additions and 40 deletions

View 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])%>

View 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>

View File

@ -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 %>