diff --git a/lib/jekyll/document.rb b/lib/jekyll/document.rb index be4ead20..7d8d05d5 100644 --- a/lib/jekyll/document.rb +++ b/lib/jekyll/document.rb @@ -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. diff --git a/lib/jekyll/renderer.rb b/lib/jekyll/renderer.rb index e3d233df..f918cc0d 100644 --- a/lib/jekyll/renderer.rb +++ b/lib/jekyll/renderer.rb @@ -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.