Don't place asset files or yaml files in layouts

Ref: #2402
This commit is contained in:
Parker Moore 2014-05-20 17:11:34 -04:00
parent beeca433ae
commit cbe7e3e80e
2 changed files with 17 additions and 5 deletions

View File

@ -88,6 +88,14 @@ module Jekyll
!(asset_file? || yaml_file?)
end
# Determine whether the file should be placed into layouts.
#
# Returns false if the document is either an asset file or a yaml file,
# true otherwise.
def place_in_layout?
!(asset_file? || yaml_file?)
end
# The URL template where the document would be accessible.
#
# Returns the URL template for the document.

View File

@ -47,11 +47,15 @@ module Jekyll
output = render_liquid(output, payload, info)
end
place_in_layouts(
convert(output),
payload,
info
)
if document.place_in_layout?
place_in_layouts(
convert(output),
payload,
info
)
else
convert(output)
end
end
# Convert the given content using the converters which match this renderer's document.