Merge remote-tracking branch 'origin/3.0-stable'
Conflicts: middleman-core/lib/middleman-core/core_extensions/data.rb middleman-core/lib/middleman-core/core_extensions/front_matter.rb middleman-core/lib/middleman-core/util.rb middleman-core/middleman-core-x86-mingw32.gemspec middleman-more/lib/middleman-more/core_extensions/default_helpers.rb middleman-more/lib/middleman-more/core_extensions/i18n.rb
This commit is contained in:
commit
52c4677391
28 changed files with 440 additions and 115 deletions
|
@ -1,4 +1,5 @@
|
|||
require "active_support/core_ext/hash/keys"
|
||||
require 'pathname'
|
||||
|
||||
# Extensions namespace
|
||||
module Middleman::CoreExtensions
|
||||
|
@ -130,7 +131,12 @@ module Middleman::CoreExtensions
|
|||
# @param [String] path
|
||||
# @return [Array<Thor::CoreExt::HashWithIndifferentAccess, String>]
|
||||
def frontmatter_and_content(path)
|
||||
full_path = File.expand_path(File.join(@app.source_dir, path))
|
||||
full_path = if Pathname(path).relative?
|
||||
File.join(@app.source_dir, path)
|
||||
else
|
||||
path
|
||||
end
|
||||
|
||||
data = {}
|
||||
content = nil
|
||||
|
||||
|
@ -158,7 +164,7 @@ module Middleman::CoreExtensions
|
|||
end
|
||||
|
||||
def normalize_path(path)
|
||||
path.sub(@app.source_dir, "").sub(/^\//, "")
|
||||
path.sub(%r{^#{@app.source_dir}\/}, "")
|
||||
end
|
||||
|
||||
# Update the main sitemap resource list
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue