mirror of
https://github.com/meineerde/holgerjust.de.git
synced 2025-10-17 17:01:01 +00:00
Add webp images for Chrome and Firefox
This commit is contained in:
parent
96c72065ef
commit
14f01a1ab6
3
Gemfile
3
Gemfile
@ -14,3 +14,6 @@ gem 'redcarpet', '~> 3.3.2'
|
|||||||
|
|
||||||
# For "summary"-Helper
|
# For "summary"-Helper
|
||||||
gem 'nokogiri', '~> 1.6.6.2'
|
gem 'nokogiri', '~> 1.6.6.2'
|
||||||
|
|
||||||
|
# Images
|
||||||
|
gem 'middleman-webp', '~> 0.3.2'
|
||||||
|
|||||||
@ -94,6 +94,8 @@ GEM
|
|||||||
middleman-syntax (2.0.0)
|
middleman-syntax (2.0.0)
|
||||||
middleman-core (~> 3.2)
|
middleman-core (~> 3.2)
|
||||||
rouge (~> 1.0)
|
rouge (~> 1.0)
|
||||||
|
middleman-webp (0.3.2)
|
||||||
|
middleman-core (>= 3.3.0, < 3.5.0)
|
||||||
mime-types (2.6.1)
|
mime-types (2.6.1)
|
||||||
mini_portile (0.6.2)
|
mini_portile (0.6.2)
|
||||||
minitest (5.8.0)
|
minitest (5.8.0)
|
||||||
@ -153,8 +155,9 @@ DEPENDENCIES
|
|||||||
middleman-deploy (~> 1.0)
|
middleman-deploy (~> 1.0)
|
||||||
middleman-livereload (~> 3.4.3)
|
middleman-livereload (~> 3.4.3)
|
||||||
middleman-syntax (~> 2.0.0)
|
middleman-syntax (~> 2.0.0)
|
||||||
|
middleman-webp (~> 0.3.2)
|
||||||
nokogiri (~> 1.6.6.2)
|
nokogiri (~> 1.6.6.2)
|
||||||
redcarpet (~> 3.3.2)
|
redcarpet (~> 3.3.2)
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
1.10.6
|
1.14.3
|
||||||
|
|||||||
@ -210,6 +210,14 @@ set :haml, {
|
|||||||
escape_attrs: :once
|
escape_attrs: :once
|
||||||
}
|
}
|
||||||
|
|
||||||
|
activate :webp do |webp|
|
||||||
|
webp.conversion_options = {
|
||||||
|
'images/**/*.{png,gif}' => {lossless: true},
|
||||||
|
'images/**/*.{jpg,jpeg}' => {q: 100}
|
||||||
|
}
|
||||||
|
webp.append_extension = true
|
||||||
|
end
|
||||||
|
|
||||||
set :css_dir, 'stylesheets'
|
set :css_dir, 'stylesheets'
|
||||||
set :js_dir, 'javascripts'
|
set :js_dir, 'javascripts'
|
||||||
set :images_dir, 'images'
|
set :images_dir, 'images'
|
||||||
|
|||||||
@ -30,8 +30,8 @@ ExpiresDefault "access plus 1 year"
|
|||||||
</FilesMatch>
|
</FilesMatch>
|
||||||
|
|
||||||
# Unset the Vary: Host header inserted by global Uberspace config
|
# Unset the Vary: Host header inserted by global Uberspace config
|
||||||
# Append Vary: Accept-Encoding due to optionsl gziped content
|
# Append Vary: Accept due to optional gziped content
|
||||||
Header set Vary Accept-Encoding
|
Header set Vary Accept
|
||||||
|
|
||||||
# Add security related headers
|
# Add security related headers
|
||||||
Header set X-Frame-Options "DENY"
|
Header set X-Frame-Options "DENY"
|
||||||
@ -58,3 +58,10 @@ RewriteRule ^favicon.ico$ /images/favicon.ico
|
|||||||
RewriteCond %{HTTP:Accept-Encoding} \b(x-)?gzip\b
|
RewriteCond %{HTTP:Accept-Encoding} \b(x-)?gzip\b
|
||||||
RewriteCond %{REQUEST_FILENAME}\.gz -s
|
RewriteCond %{REQUEST_FILENAME}\.gz -s
|
||||||
RewriteRule ^(.+) /$1\.gz [QSA]
|
RewriteRule ^(.+) /$1\.gz [QSA]
|
||||||
|
|
||||||
|
# Check if browser support WebP images
|
||||||
|
RewriteCond %{HTTP:Accept} image/webp
|
||||||
|
RewriteCond %{REQUEST_FILENAME}\.webp -s
|
||||||
|
RewriteRule ^(.+) /$1\.webp [QSA]
|
||||||
|
|
||||||
|
AddType image/webp .webp
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user