While reusing a few pug files I stumbled across this:
This compiles and is rendered:
<%=
{{`pug -p /path/to/includes < #{__DIR__}/index.pug`.stringify}}
%>
But can’t be formatted:
syntax error in 'STDIN:1:1': unexpected token: "<"
But this can be formatted:
# <%=
{{`pug -p /path/to/includes < #{__DIR__}/index.pug`.stringify}}
# %>
But doesn’t compile:
In src/index.ecr:5:1
Error: unexpected token: EOF
P.S.:
I’m doing this:
get "/" do |env|
render "#{__DIR__}/index.ecr"
end
…
# index.pug
doctype html
html(lang='zxx')
head
include ./head.pug
body
include ./body.pug
What am I doing wrong?