mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-17 14:26:51 +00:00
Improve cache busting (#11846)
This commit is contained in:
parent
528870549a
commit
0f7a8aa73b
10
plugins/cache_buster.rb
Normal file
10
plugins/cache_buster.rb
Normal file
@ -0,0 +1,10 @@
|
||||
module Jekyll
|
||||
module CacheBuster
|
||||
require 'digest/md5'
|
||||
def cache_buster(file_name)
|
||||
[file_name, '?', Digest::MD5.hexdigest(File.read(File.join('./source', file_name)))].join
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Liquid::Template.register_filter(Jekyll::CacheBuster)
|
@ -5,7 +5,7 @@ g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js
|
||||
s.parentNode.insertBefore(g,s)}(document,'script'));
|
||||
</script>
|
||||
|
||||
<script src="/javascripts/prism.js?{{ site.time | date: '%s' }}" type="text/javascript"></script>
|
||||
<script src="{{ '/javascripts/prism.js' | cache_buster }}" type="text/javascript"></script>
|
||||
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css" />
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script>
|
||||
|
@ -28,8 +28,8 @@
|
||||
<meta name="twitter:description" content="{{ page.description | default: site.description | strip_html | truncate: 200 }}">
|
||||
<meta name="twitter:image" content="{{ page.og_image | default: "/images/default-social.png" | prepend: site.url }}">
|
||||
|
||||
<link href="/stylesheets/prism.css?{{ site.time | date: '%s' }}" rel="stylesheet">
|
||||
<link href="/stylesheets/screen.css?{{ site.time | date: '%s' }}" media="screen, projection, print" rel="stylesheet">
|
||||
<link href="{{ '/stylesheets/prism.css' | cache_buster }}" rel="stylesheet">
|
||||
<link href="{{ '/stylesheets/screen.css' | cache_buster }}" media="screen, projection, print" rel="stylesheet">
|
||||
<link href="{{ site.subscribe_rss }}" rel="alternate" title="{{ site.title }}" type="application/atom+xml">
|
||||
<link rel='shortcut icon' href='/images/favicon.ico' />
|
||||
<link rel='icon' type='image/png' href='/images/favicon-192x192.png' sizes='192x192' />
|
||||
|
Loading…
x
Reference in New Issue
Block a user