Be a bit safer about checking source_file in Sitemap Preview. Working towards fixing #1166

This commit is contained in:
Thomas Reynolds 2014-10-20 11:24:52 -07:00
parent e36054b605
commit 65d3a0c84f
2 changed files with 5 additions and 1 deletions

View file

@ -39,7 +39,7 @@ module Middleman
build_path = 'Not built' if ignored?
props['Build Path'] = build_path if @resource.path != build_path
props['URL'] = content_tag(:a, @resource.url, href: @resource.url) unless ignored?
props['Source File'] = @resource.source_file.sub(/^#{Regexp.escape(ENV['MM_ROOT'] + '/')}/, '')
props['Source File'] = @resource.source_file ? @resource.source_file.sub(/^#{Regexp.escape(ENV['MM_ROOT'] + '/')}/, '') : 'Dynamic'
data = @resource.data
props['Data'] = data.inspect unless data.empty?

View file

@ -66,6 +66,10 @@ module Middleman
super(store, path)
end
def get_source_file
nil
end
def template?
true
end