Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion _includes/head.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<head>
<link rel="stylesheet" href="/styles/main.css?s={{ 'now' | date: '%s' }}">
{% assign sum = 'styles/*.{,s}css' | checksum %}
<link rel="stylesheet" href="/styles/main-light.css?s={{ sum }}">
<link rel="stylesheet" href="/styles/main-dark.css?s={{ sum }}" media="(prefers-color-scheme: dark)">
<link rel="icon" type="image/svg+xml" href="/images/logos/guac-classic-logo.svg"/>
<link rel="icon" type="image/png" href="/images/logos/guac-classic-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"/>
Expand Down
46 changes: 46 additions & 0 deletions _plugins/checksum.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

require 'digest'

module GuacChecksumFilter

#
# Returns an arbitrary, unique checksum for the files matching the given
# glob pattern, calculated from each file's contents. The resulting checksum
# is guaranteed to be safe for inclusion within URLs.
#
# == Parameters:
# input::
# The glob pattern matching the files to use to generate the checksum.
#
# == Returns:
# An arbitrary, unique checksum generated from the contents of each matching
# file.
#
def checksum(input)
digest = Dir.glob(input).sort().reduce(Digest::SHA2) { |digest, filename| digest.file filename }
digest.hexdigest
end

end

# Register checksum filter with Liquid
Liquid::Template.register_filter(GuacChecksumFilter)

1 change: 1 addition & 0 deletions images/backgrounds/bowl-clip-bottom-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions images/backgrounds/bowl-clip-top-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions images/home/feature-access-anywhere-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions images/home/feature-access-anywhere-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion images/home/feature-access-anywhere.svg

This file was deleted.

1 change: 1 addition & 0 deletions images/home/feature-cloud-desktop-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions images/home/feature-cloud-desktop-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion images/home/feature-cloud-desktop.svg

This file was deleted.

1 change: 1 addition & 0 deletions images/home/feature-open-source-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading