You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by vn...@apache.org on 2017/08/05 21:15:16 UTC

[1/2] incubator-guacamole-website git commit: Add cache-busting checksum to main.css link in head.

Repository: incubator-guacamole-website
Updated Branches:
  refs/heads/master c3f58aa0b -> 379abe09a


Add cache-busting checksum to main.css link in head.


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-website/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-website/commit/2e7f6f46
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-website/tree/2e7f6f46
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-website/diff/2e7f6f46

Branch: refs/heads/master
Commit: 2e7f6f4622a4a76dba8ac415e3b4d20728760b10
Parents: c3f58aa
Author: Michael Jumper <mj...@apache.org>
Authored: Sat Aug 5 12:12:15 2017 -0700
Committer: Michael Jumper <mj...@apache.org>
Committed: Sat Aug 5 12:17:17 2017 -0700

----------------------------------------------------------------------
 _includes/head.html  |  4 +++-
 _plugins/checksum.rb | 27 +++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-website/blob/2e7f6f46/_includes/head.html
----------------------------------------------------------------------
diff --git a/_includes/head.html b/_includes/head.html
index 8264788..7bcf1fa 100644
--- a/_includes/head.html
+++ b/_includes/head.html
@@ -1,5 +1,7 @@
 <head>
-    <link rel="stylesheet" href="/styles/main.css">
+    <link rel="stylesheet" href="/styles/main.css?s={{
+        'styles/main.css' | checksum
+    }}">
     <link rel="icon" type="image/png" href="/images/guacamole-logo-64.png"/>
     <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi"/>
     <meta charset="UTF-8"/>

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-website/blob/2e7f6f46/_plugins/checksum.rb
----------------------------------------------------------------------
diff --git a/_plugins/checksum.rb b/_plugins/checksum.rb
new file mode 100644
index 0000000..d528d4a
--- /dev/null
+++ b/_plugins/checksum.rb
@@ -0,0 +1,27 @@
+require 'digest'
+
+module GuacChecksumFilter
+
+    #
+    # Returns an arbitrary, unique checksum for the given file, calculated from
+    # the file's contents. The resulting checksum is guaranteed to be safe for
+    # inclusion within URLs.
+    #
+    # == Parameters:
+    # input::
+    #     The name of the file to use to generate the checksum.
+    # 
+    # == Returns:
+    # An arbitrary, unique checksum generated from the contents of the given
+    # file.
+    #
+    def checksum(input)
+        digest = Digest::MD5.file input
+        digest.hexdigest
+    end
+
+end
+
+# Register checksum filter with Liquid
+Liquid::Template.register_filter(GuacChecksumFilter)
+


[2/2] incubator-guacamole-website git commit: Merge add cache-busting checksum to main.css link in head.

Posted by vn...@apache.org.
Merge add cache-busting checksum to main.css link in head.


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-website/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-website/commit/379abe09
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-website/tree/379abe09
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-website/diff/379abe09

Branch: refs/heads/master
Commit: 379abe09adc3d0bfa7979047563f3e4e5c7200cd
Parents: c3f58aa 2e7f6f4
Author: Nick Couchman <vn...@apache.org>
Authored: Sat Aug 5 17:14:06 2017 -0400
Committer: Nick Couchman <vn...@apache.org>
Committed: Sat Aug 5 17:14:06 2017 -0400

----------------------------------------------------------------------
 _includes/head.html  |  4 +++-
 _plugins/checksum.rb | 27 +++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletion(-)
----------------------------------------------------------------------