mirror of
https://github.com/middleman/middleman.git
synced 2022-11-09 12:20:27 -05:00
Add :relative_assets to default config.rb, allow overriding with --relative from mm-build command
This commit is contained in:
parent
7b666cb7c2
commit
856d1398c2
6 changed files with 25 additions and 3 deletions
|
@ -13,4 +13,9 @@ Feature: Builder
|
|||
Then "stylesheets/test_less.css" should exist and include "666"
|
||||
Then "stylesheets/static.css" should exist and include "body"
|
||||
Then "_partial.html" should not exist
|
||||
And cleanup built test app
|
||||
|
||||
Scenario: Force relative assets
|
||||
Given a built test app with flags "--relative"
|
||||
Then "stylesheets/site.css" should exist and include "../"
|
||||
And cleanup built test app
|
|
@ -6,6 +6,12 @@ Given /^a built test app$/ do
|
|||
`cd #{target} && MM_DIR="#{target}" #{build_cmd}`
|
||||
end
|
||||
|
||||
Given /^a built test app with flags "([^"]*)"$/ do |flags|
|
||||
target = File.join(File.dirname(File.dirname(File.dirname(__FILE__))), "fixtures", "test-app")
|
||||
build_cmd = File.expand_path(File.join(File.dirname(File.dirname(File.dirname(__FILE__))), "bin", "mm-build"))
|
||||
`cd #{target} && MM_DIR="#{target}" #{build_cmd} #{flags}`
|
||||
end
|
||||
|
||||
Given /^cleanup built test app$/ do
|
||||
target = File.join(File.dirname(File.dirname(File.dirname(__FILE__))), "fixtures", "test-app", "build")
|
||||
FileUtils.rm_rf(target)
|
||||
|
|
|
@ -27,9 +27,15 @@ module Middleman
|
|||
include Thor::Actions
|
||||
include Middleman::ThorActions
|
||||
|
||||
class_option :relative, :type => :boolean, :aliases => "-r", :default => false, :desc => 'Override the config.rb file and force relative urls'
|
||||
|
||||
def initialize(*args)
|
||||
Middleman::Server.new
|
||||
super
|
||||
|
||||
Middleman::Server.new
|
||||
if options.has_key?("relative") && options["relative"]
|
||||
Middleman::Server.activate :relative_assets
|
||||
end
|
||||
end
|
||||
|
||||
def source_paths
|
||||
|
|
|
@ -51,10 +51,12 @@ configure :build do
|
|||
|
||||
# Enable cache buster
|
||||
# activate :cache_buster
|
||||
|
||||
# Use relative URLs
|
||||
# activate :relative_assets
|
||||
|
||||
# Generate ugly/obfuscated HTML from Haml
|
||||
# activate :ugly_haml
|
||||
|
||||
|
||||
# Or use a different image path
|
||||
# set :http_path, "/Content/images/"
|
||||
|
|
|
@ -39,6 +39,9 @@ configure :build do
|
|||
|
||||
# Enable cache buster
|
||||
# activate :cache_buster
|
||||
|
||||
# Use relative URLs
|
||||
# activate :relative_assets
|
||||
|
||||
# Generate ugly/obfuscated HTML from Haml
|
||||
# activate :ugly_haml
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
module Middleman
|
||||
VERSION = "1.1.2"
|
||||
VERSION = "1.1.3"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue