Merge pull request #1781 from FearGoidte/master

Support for .xhtml
This commit is contained in:
Thomas Reynolds 2016-01-28 10:50:39 -08:00
commit 8c27d9a2e7
7 changed files with 8 additions and 8 deletions

View file

@ -22,7 +22,7 @@ Feature: GZIP assets during build
Given a fixture app "gzip-app"
And a file named "config.rb" with:
"""
activate :gzip, exts: %w(.js .html .htm)
activate :gzip, exts: %w(.htm .html .js .xhtml)
"""
And a successfully built app at "gzip-app"
Then the following files should exist:

View file

@ -154,7 +154,7 @@ module Middleman
# Which file extensions have a layout by default.
# @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.
# @return [String]

View file

@ -2,7 +2,7 @@ require 'middleman-core/util'
require 'middleman-core/rack'
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 :ignore, [], 'Regexes of filenames to skip adding asset hashes to'
option :rewrite_ignore, [], 'Regexes of filenames to skip processing for path rewrites'

View file

@ -3,7 +3,7 @@ require 'addressable/uri'
class Middleman::Extensions::AssetHost < ::Middleman::Extension
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 :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 :rewrite_ignore, [], 'Regexes of filenames to skip processing for host rewrites'

View file

@ -1,7 +1,7 @@
# The Cache Buster 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 :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 :rewrite_ignore, [], 'Regexes of filenames to skip processing for path rewrites'

View file

@ -7,10 +7,10 @@
# 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
# to .html, .htm, .js and .css.
# to .css, .htm, .html, .js, and .xhtml
#
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), 'File extensions to Gzip when building.'
option :ignore, [], 'Patterns to avoid gzipping'
option :overwrite, false, 'Overwrite original files instead of adding .gz extension.'

View file

@ -3,7 +3,7 @@ require 'addressable/uri'
# Relative Assets 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 :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 :rewrite_ignore, [], 'Regexes of filenames to skip processing for path rewrites'