diff --git a/app/views/common/_discourse_stylesheet.html.erb b/app/views/common/_discourse_stylesheet.html.erb
new file mode 100644
index 00000000000..6f81b70913f
--- /dev/null
+++ b/app/views/common/_discourse_stylesheet.html.erb
@@ -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])%>
\ No newline at end of file
diff --git a/app/views/common/_special_font_face.html.erb b/app/views/common/_special_font_face.html.erb
new file mode 100644
index 00000000000..bad6846bf53
--- /dev/null
+++ b/app/views/common/_special_font_face.html.erb
@@ -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}" %>
+
+
\ No newline at end of file
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index 52ccbb50b8f..f314b2819a0 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -19,48 +19,11 @@
<%= 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}" %>
-
-
- <%- 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%>
@@ -97,7 +60,7 @@
<%= yield :data %>
-
+
<%= render :partial => "common/discourse_javascript" %>
<%= render_google_analytics_code %>