Support for .xhtml
I’ve attempted to make support for .htm and .xhtml consistent. Extensions are in alphabetical order to make it easier to compare them.
This commit is contained in:
parent
2bba7888b0
commit
475fa41de0
|
@ -22,7 +22,7 @@ Feature: GZIP assets during build
|
||||||
Given a fixture app "gzip-app"
|
Given a fixture app "gzip-app"
|
||||||
And a file named "config.rb" with:
|
And a file named "config.rb" with:
|
||||||
"""
|
"""
|
||||||
activate :gzip, exts: %w(.js .html .htm)
|
activate :gzip, exts: %w(.htm .html .js .xhtml .xml)
|
||||||
"""
|
"""
|
||||||
And a successfully built app at "gzip-app"
|
And a successfully built app at "gzip-app"
|
||||||
Then the following files should exist:
|
Then the following files should exist:
|
||||||
|
|
|
@ -154,7 +154,7 @@ module Middleman
|
||||||
|
|
||||||
# Which file extensions have a layout by default.
|
# Which file extensions have a layout by default.
|
||||||
# @return [Array.<String>]
|
# @return [Array.<String>]
|
||||||
define_setting :extensions_with_layout, %w(.html .xhtml .php), 'Which file extensions have a layout by default.'
|
define_setting :extensions_with_layout, %w(.htm .html .xhtml .php), 'Which file extensions have a layout by default.'
|
||||||
|
|
||||||
# Default string encoding for templates and output.
|
# Default string encoding for templates and output.
|
||||||
# @return [String]
|
# @return [String]
|
||||||
|
|
|
@ -2,7 +2,7 @@ require 'middleman-core/util'
|
||||||
require 'middleman-core/rack'
|
require 'middleman-core/rack'
|
||||||
|
|
||||||
class Middleman::Extensions::AssetHash < ::Middleman::Extension
|
class Middleman::Extensions::AssetHash < ::Middleman::Extension
|
||||||
option :sources, %w(.htm .html .php .css .js), 'List of extensions that are searched for hashable assets.'
|
option :sources, %w(.css .htm .html .js .php .xhtml), 'List of extensions that are searched for hashable assets.'
|
||||||
option :exts, %w(.jpg .jpeg .png .gif .webp .js .css .otf .woff .woff2 .eot .ttf .svg .svgz), 'List of extensions that get asset hashes appended to them.'
|
option :exts, %w(.jpg .jpeg .png .gif .webp .js .css .otf .woff .woff2 .eot .ttf .svg .svgz), 'List of extensions that get asset hashes appended to them.'
|
||||||
option :ignore, [], 'Regexes of filenames to skip adding asset hashes to'
|
option :ignore, [], 'Regexes of filenames to skip adding asset hashes to'
|
||||||
option :rewrite_ignore, [], 'Regexes of filenames to skip processing for path rewrites'
|
option :rewrite_ignore, [], 'Regexes of filenames to skip processing for path rewrites'
|
||||||
|
|
|
@ -3,7 +3,7 @@ require 'addressable/uri'
|
||||||
class Middleman::Extensions::AssetHost < ::Middleman::Extension
|
class Middleman::Extensions::AssetHost < ::Middleman::Extension
|
||||||
option :host, nil, 'The asset host to use or a Proc to determine asset host', required: true
|
option :host, nil, 'The asset host to use or a Proc to determine asset host', required: true
|
||||||
option :exts, %w(.css .png .jpg .jpeg .webp .svg .svgz .js .gif), 'List of extensions that get cache busters strings appended to them.'
|
option :exts, %w(.css .png .jpg .jpeg .webp .svg .svgz .js .gif), 'List of extensions that get cache busters strings appended to them.'
|
||||||
option :sources, %w(.htm .html .php .css .js), 'List of extensions that are searched for bustable assets.'
|
option :sources, %w(.css .htm .html .js .php .xhtml), 'List of extensions that are searched for bustable assets.'
|
||||||
option :ignore, [], 'Regexes of filenames to skip adding query strings to'
|
option :ignore, [], 'Regexes of filenames to skip adding query strings to'
|
||||||
option :rewrite_ignore, [], 'Regexes of filenames to skip processing for host rewrites'
|
option :rewrite_ignore, [], 'Regexes of filenames to skip processing for host rewrites'
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# The Cache Buster extension
|
# The Cache Buster extension
|
||||||
class Middleman::Extensions::CacheBuster < ::Middleman::Extension
|
class Middleman::Extensions::CacheBuster < ::Middleman::Extension
|
||||||
option :exts, %w(.css .png .jpg .jpeg .webp .svg .svgz .js .gif), 'List of extensions that get cache busters strings appended to them.'
|
option :exts, %w(.css .png .jpg .jpeg .webp .svg .svgz .js .gif), 'List of extensions that get cache busters strings appended to them.'
|
||||||
option :sources, %w(.htm .html .php .css .js), 'List of extensions that are searched for bustable assets.'
|
option :sources, %w(.css .htm .html .js .php .xhtml), 'List of extensions that are searched for bustable assets.'
|
||||||
option :ignore, [], 'Regexes of filenames to skip adding query strings to'
|
option :ignore, [], 'Regexes of filenames to skip adding query strings to'
|
||||||
option :rewrite_ignore, [], 'Regexes of filenames to skip processing for path rewrites'
|
option :rewrite_ignore, [], 'Regexes of filenames to skip processing for path rewrites'
|
||||||
|
|
||||||
|
|
|
@ -7,10 +7,10 @@
|
||||||
# to serve your Gzipped files whenever the normal (non-.gz) filename is requested.
|
# to serve your Gzipped files whenever the normal (non-.gz) filename is requested.
|
||||||
#
|
#
|
||||||
# Pass the :exts options to customize which file extensions get zipped (defaults
|
# Pass the :exts options to customize which file extensions get zipped (defaults
|
||||||
# to .html, .htm, .js and .css.
|
# to .css, .htm, .html, .js, and .xhtml
|
||||||
#
|
#
|
||||||
class Middleman::Extensions::Gzip < ::Middleman::Extension
|
class Middleman::Extensions::Gzip < ::Middleman::Extension
|
||||||
option :exts, %w(.js .css .html .htm .svg), 'File extensions to Gzip when building.'
|
option :exts, %w(.css .htm .html .js .svg .xhtml .xml), 'File extensions to Gzip when building.'
|
||||||
option :ignore, [], 'Patterns to avoid gzipping'
|
option :ignore, [], 'Patterns to avoid gzipping'
|
||||||
option :overwrite, false, 'Overwrite original files instead of adding .gz extension.'
|
option :overwrite, false, 'Overwrite original files instead of adding .gz extension.'
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ require 'addressable/uri'
|
||||||
# Relative Assets extension
|
# Relative Assets extension
|
||||||
class Middleman::Extensions::RelativeAssets < ::Middleman::Extension
|
class Middleman::Extensions::RelativeAssets < ::Middleman::Extension
|
||||||
option :exts, %w(.css .png .jpg .jpeg .webp .svg .svgz .js .gif .ttf .otf .woff .woff2 .eot), 'List of extensions that get cache busters strings appended to them.'
|
option :exts, %w(.css .png .jpg .jpeg .webp .svg .svgz .js .gif .ttf .otf .woff .woff2 .eot), 'List of extensions that get cache busters strings appended to them.'
|
||||||
option :sources, %w(.htm .html .css), 'List of extensions that are searched for relative assets.'
|
option :sources, %w(.css .htm .html .xhtml), 'List of extensions that are searched for relative assets.'
|
||||||
option :ignore, [], 'Regexes of filenames to skip adding query strings to'
|
option :ignore, [], 'Regexes of filenames to skip adding query strings to'
|
||||||
option :rewrite_ignore, [], 'Regexes of filenames to skip processing for path rewrites'
|
option :rewrite_ignore, [], 'Regexes of filenames to skip processing for path rewrites'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue