Skip to content

Commit cde0dc5

Browse files
committed
feat: add support cache busting
1 parent 2ff79ee commit cde0dc5

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

gulpfile.babel.js

+10-7
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,18 @@ const watchFiles = () => {
6868
"static/**/*.js",
6969
"!static/**/bootstrap.css",
7070
"!static/**/bootstrap_responsive.css",
71-
"!static/**/elegant.prod.css",
72-
"!static/js/elegant.prod.js"
71+
"!static/**/elegant.prod.e4bd582858.css",
72+
"!static/js/elegant.prod.e4bd582858.js"
7373
],
7474
{ ignoreInitial: false },
7575
buildAll
7676
);
7777
};
7878

79-
const pathProdCSS = path.join(__dirname, "static/css/elegant.prod.css");
79+
const pathProdCSS = path.join(
80+
__dirname,
81+
"static/css/elegant.prod.e4bd582858.css"
82+
);
8083
const rmProdCSS = cb => {
8184
if (fs.existsSync(pathProdCSS)) {
8285
fs.unlinkSync(pathProdCSS);
@@ -93,9 +96,9 @@ const minifyJS = () => {
9396
"static/clipboard/clipboard.js",
9497
"static/js/copy-to-clipboard.js",
9598
"static/js/lunr-search-result.js",
96-
"!static/js/elegant.prod.js"
99+
"!static/js/elegant.prod.e4bd582858.js"
97100
])
98-
.pipe(concat("elegant.prod.js"))
101+
.pipe(concat("elegant.prod.e4bd582858.js"))
99102
.pipe(terser())
100103
.pipe(dest("static/js/"));
101104
};
@@ -113,10 +116,10 @@ const compileCSS = () => {
113116
"static/photoswipe/photoswipe.css",
114117
"static/photoswipe/default-skin/default-skin.css",
115118
"static/css/*.css",
116-
"!static/css/elegant.prod.css"
119+
"!static/css/elegant.prod.e4bd582858.css"
117120
])
118121
.pipe(postcss(plugins))
119-
.pipe(concat("elegant.prod.css"))
122+
.pipe(concat("elegant.prod.e4bd582858.css"))
120123
.pipe(dest("static/css/"));
121124
};
122125

File renamed without changes.
File renamed without changes.

templates/base.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
{% if 'assets' in PLUGINS %}
4343
{% include '_includes/minify_css.html' with context %}
4444
{% else %}
45-
<link rel="stylesheet" type="text/css" href="{{ SITEURL }}/theme/css/elegant.prod.css" media="screen">
45+
<link rel="stylesheet" type="text/css" href="{{ SITEURL }}/theme/css/elegant.prod.e4bd582858.css" media="screen">
4646
<link rel="stylesheet" type="text/css" href="{{ SITEURL }}/theme/css/custom.css" media="screen">
4747
{% endif %}
4848
{% endblock head_links %}
@@ -107,7 +107,7 @@
107107
{% endif %}
108108
<script src="//code.jquery.com/jquery.min.js"></script>
109109
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
110-
<script src="{{ SITEURL }}/theme/js/elegant.prod.js"></script>
110+
<script src="{{ SITEURL }}/theme/js/elegant.prod.e4bd582858.js"></script>
111111
<script>
112112
function validateForm(query)
113113
{

0 commit comments

Comments
 (0)