mirror of
https://github.com/middleman/middleman.git
synced 2022-11-09 12:20:27 -05:00
Merge branch 'master' of github.com:middleman/middleman
This commit is contained in:
commit
fe2a7c4dd6
13 changed files with 31 additions and 6 deletions
|
@ -22,6 +22,7 @@
|
||||||
3.1.0.rc.1
|
3.1.0.rc.1
|
||||||
===
|
===
|
||||||
|
|
||||||
|
* Fix ignoring layouts from the sitemap when the source directory has been set to something other than 'source'. #896
|
||||||
* Move more into core, autoloaded if gems are available.
|
* Move more into core, autoloaded if gems are available.
|
||||||
* DataStore may now be accessed like a hash with #[] and #has_key?. #880
|
* DataStore may now be accessed like a hash with #[] and #has_key?. #880
|
||||||
* The i18n extension now supports providing localized templates as separate files, like index.es.html.haml. #816, #823
|
* The i18n extension now supports providing localized templates as separate files, like index.es.html.haml. #816, #823
|
||||||
|
|
7
middleman-core/features/custom-source.feature
Normal file
7
middleman-core/features/custom-source.feature
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
Feature: Support customizing the source directory name
|
||||||
|
|
||||||
|
Scenario: Layouts don't try to build
|
||||||
|
Given a successfully built app at "custom-src-app"
|
||||||
|
When I cd to "build"
|
||||||
|
Then the following files should not exist:
|
||||||
|
| layouts/layout.html |
|
|
@ -13,9 +13,11 @@ Feature: i18n Builder
|
||||||
| index.html |
|
| index.html |
|
||||||
| hello.html |
|
| hello.html |
|
||||||
| morning.html |
|
| morning.html |
|
||||||
|
| one.html |
|
||||||
| es/index.html |
|
| es/index.html |
|
||||||
| es/hola.html |
|
| es/hola.html |
|
||||||
| es/manana.html |
|
| es/manana.html |
|
||||||
|
| es/una.html |
|
||||||
| CNAME |
|
| CNAME |
|
||||||
| password.txt |
|
| password.txt |
|
||||||
Then the following files should not exist:
|
Then the following files should not exist:
|
||||||
|
@ -23,9 +25,11 @@ Feature: i18n Builder
|
||||||
And the file "index.html" should contain "Howdy"
|
And the file "index.html" should contain "Howdy"
|
||||||
And the file "hello.html" should contain "Hello World"
|
And the file "hello.html" should contain "Hello World"
|
||||||
And the file "morning.html" should contain "Good morning"
|
And the file "morning.html" should contain "Good morning"
|
||||||
|
And the file "one.html" should contain "Only one"
|
||||||
And the file "es/index.html" should contain "Como Esta?"
|
And the file "es/index.html" should contain "Como Esta?"
|
||||||
And the file "es/hola.html" should contain "Hola World"
|
And the file "es/hola.html" should contain "Hola World"
|
||||||
And the file "es/manana.html" should contain "Buenos días"
|
And the file "es/manana.html" should contain "Buenos días"
|
||||||
|
And the file "es/una.html" should contain "Solamente una"
|
||||||
And the file "CNAME" should contain "test.github.com"
|
And the file "CNAME" should contain "test.github.com"
|
||||||
And the file "password.txt" should contain "hunter2"
|
And the file "password.txt" should contain "hunter2"
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,8 @@ Feature: i18n Preview
|
||||||
Then I should see "Hello World"
|
Then I should see "Hello World"
|
||||||
When I go to "/morning.html"
|
When I go to "/morning.html"
|
||||||
Then I should see "Good morning"
|
Then I should see "Good morning"
|
||||||
|
When I go to "/one.html"
|
||||||
|
Then I should see "Only one"
|
||||||
When I go to "/en/index.html"
|
When I go to "/en/index.html"
|
||||||
Then I should see "File Not Found"
|
Then I should see "File Not Found"
|
||||||
When I go to "/en/morning.html"
|
When I go to "/en/morning.html"
|
||||||
|
@ -24,6 +26,8 @@ Feature: i18n Preview
|
||||||
Then I should see "Hola World"
|
Then I should see "Hola World"
|
||||||
When I go to "/es/manana.html"
|
When I go to "/es/manana.html"
|
||||||
Then I should see "Buenos días"
|
Then I should see "Buenos días"
|
||||||
|
When I go to "/es/una.html"
|
||||||
|
Then I should see "Solamente una"
|
||||||
|
|
||||||
Scenario: A template changes i18n during preview
|
Scenario: A template changes i18n during preview
|
||||||
Given a fixture app "i18n-test-app"
|
Given a fixture app "i18n-test-app"
|
||||||
|
|
1
middleman-core/fixtures/custom-src-app/config.rb
Normal file
1
middleman-core/fixtures/custom-src-app/config.rb
Normal file
|
@ -0,0 +1 @@
|
||||||
|
set :source, 'src'
|
0
middleman-core/fixtures/custom-src-app/src/index.html
Normal file
0
middleman-core/fixtures/custom-src-app/src/index.html
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<%= yield %>
|
|
@ -3,6 +3,7 @@ es:
|
||||||
paths:
|
paths:
|
||||||
hello: "hola"
|
hello: "hola"
|
||||||
morning: "manana"
|
morning: "manana"
|
||||||
|
one: "una"
|
||||||
|
|
||||||
greetings: "Como Esta?"
|
greetings: "Como Esta?"
|
||||||
hi: "Hola"
|
hi: "Hola"
|
||||||
|
|
1
middleman-core/fixtures/i18n-test-app/source/one.en.md
Normal file
1
middleman-core/fixtures/i18n-test-app/source/one.en.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Only one
|
1
middleman-core/fixtures/i18n-test-app/source/one.es.md
Normal file
1
middleman-core/fixtures/i18n-test-app/source/one.es.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Solamente una
|
|
@ -35,8 +35,8 @@ module Middleman
|
||||||
# Files starting with an underscore, but not a double-underscore
|
# Files starting with an underscore, but not a double-underscore
|
||||||
:partials => proc { |file| file =~ %r{/_} && file !~ %r{/__} },
|
:partials => proc { |file| file =~ %r{/_} && file !~ %r{/__} },
|
||||||
|
|
||||||
:layout => proc { |file|
|
:layout => proc { |file, app|
|
||||||
file.start_with?('source/layout.') || file.start_with?('source/layouts/')
|
file.start_with?(File.join(app.config[:source], 'layout.')) || file.start_with?(File.join(app.config[:source], 'layouts/'))
|
||||||
}
|
}
|
||||||
}, 'Callbacks that can exclude paths from the sitemap'
|
}, 'Callbacks that can exclude paths from the sitemap'
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,11 @@ module Middleman
|
||||||
return false unless path
|
return false unless path
|
||||||
|
|
||||||
ignored = @app.config[:ignored_sitemap_matchers].any? do |name, callback|
|
ignored = @app.config[:ignored_sitemap_matchers].any? do |name, callback|
|
||||||
callback.call(file)
|
if callback.arity == 1
|
||||||
|
callback.call(file)
|
||||||
|
else
|
||||||
|
callback.call(file, @app)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@file_paths_on_disk << file unless ignored
|
@file_paths_on_disk << file unless ignored
|
||||||
|
|
|
@ -250,7 +250,7 @@ module Middleman
|
||||||
path_bits = path.split('.')
|
path_bits = path.split('.')
|
||||||
lang = path_bits.last
|
lang = path_bits.last
|
||||||
if app.langs.include?(lang.to_sym)
|
if app.langs.include?(lang.to_sym)
|
||||||
return path_bits[0..-1].join('.')
|
return path_bits[0..-2].join('.')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue