harp
harp copied to clipboard
partial() should work with any preprocessor
Expected Behaviour
Inside templating languages, partial()
can inline any preprocessed file, like so:
style(type="text/css")=partial("css/" + current.source)
Actual Behaviour
This is only possible with other templating languages plus Markdown.
div=partial("template/" + current.source)
Makes sense.
Is there any update on this? I would like to be able to render my less files as an inline style block in order to validate against Google's accelerated mobile pages (which doesn't support linked stylesheets.)
Another option is to make the jade-filter mixin available (or upgrade to PugJS which has a built-in filter feature).
I modified my forks of harp/terraform to support partial LESS files. It works fine for my usage but it breaks some tests and I won't support it, so your mileage may vary.
Diff: https://github.com/sintaxi/terraform/compare/master...justindujardin:master
Install:
npm i --save git+https://github.com/justindujardin/harp.git
Use:
<head>
...
<%- partial("./_coolstyles.less") %>
</head>
Nice job. I can imagine this wasn't easy to get working. Lots of edge cases.
@sintaxi any chance to get this feature merged into master? I am also looking forward to include preprocessed scss into jade.