Skip to content

Commit 385ef3a

Browse files
Serve styles as CSS file
Not sure why I once decided to bundle all styles directly within all HTML responses instead of leveraging proper caching mechanisms and serving styles in a CSS file that can be cached on clients.
1 parent 0861984 commit 385ef3a

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

Diff for: _includes/head.html

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
<head>
2-
{% capture styles %}
3-
{% include main.scss %}
4-
{% endcapture %}
5-
<style>
6-
{{ styles | scssify }}
7-
</style>
8-
92
<meta charset="UTF-8">
103

114
<link rel="canonical" href="{{ site.url }}{{ page.url }}" />
@@ -18,6 +11,8 @@
1811

1912
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=">
2013

14+
<link rel="stylesheet" href="/styles.css">
15+
2116
{% if page.excerpt %}
2217
<meta property="og:description" content="{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}"/>
2318
{% else %}

Diff for: _includes/main.scss renamed to styles.scss

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
---
3+
14
@import "../_sass/normalize";
25
@import "../_sass/code";
36
@import "../_sass/style";

0 commit comments

Comments
 (0)