Closed Nowaker closed 2 years ago
Hey @Nowaker , we can treat this as a bugfix for Jekyll include. As for layout
, I don't think it makes as much sense as include
:
renderFile()
we can treat this as a bugfix for Jekyll include
That's a fantastic idea!
I created a demo for this on Jekyll: https://github.com/harttle/jekyll-include-demo The _layouts/foo.liquid included _includes/b.liquid which has leading & trailing spaces and new lines.
It turns out, in this demo, the leading & trailing spaces and new lines of the included file are preserved:
On
{% include blah.html %}
, Jekyll start-trims (removes leading whitespace) from the referenced file - equivalent offs.fileReadSync('blah.html').trimStart()
- before embedding it into the output.I'd like to ask for a new option(s) for https://liquidjs.com/tutorials/whitespace-control.html#via-Options:
trimIncludeLeft
&trimIncludeRight
trimLayoutLeft
&trimLayoutRight
- note: Jekyll useslayout: blah
in front matter for layouts, so I never used{% layout %}
in my project, so I will not use it, but it may make sense to include it for consistency withtrimIncludes
Because
{% include %}
is a built-in tag, I wasn't able to tune it to ensure Jekyll compatibility.FYI: My Jekyll-in-Gatsby project is now almost complete, with whitespace being the only difference between the builds.