pug-linker has moved to the new mono-repo: https://github.com/pugjs/pug/tree/master/packages/pug-linker
pugjs / pug-linker Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://github.com/pugjs/pug/tree/master/packages/pug-linker
Home Page: https://github.com/pugjs/pug/tree/master/packages/pug-linker
pug-linker has moved to the new mono-repo: https://github.com/pugjs/pug/tree/master/packages/pug-linker
We should add the necessary tests to cover all the code/branches, not just import all the tests from jade here.
We should also make sure in particular that we cover the edge case of jade.compile('')
and of extending an empty template.
I'm not that confident what a plugin API for the linker should look like, but my current thinking is to have the following hooks:
yield
has been applied)yield
has been applied, but skips applying yield
)yield
has been applied)We should handle raw/filtered includes somewhere else so they don't feature in this proposed plugin API.
When I have a .pug
file, I can't include
external .pug
files, without getting an error. I can include a .jade
file from a source .pug
file without issue. Going to assume for now, that we shouldn't migrate extensions over to .pug
, even though 2/3rd of the renaming seems to be done?
The associated error happens on an include
of anything other than a .jade
file, including non-existent files, .txt
files, etc.:
TypeError: Cannot read property 'replace' of undefined
at before (node_modules/pug-linker/index.js:104:48)
at walkAST (node_modules/pug-walk/index.js:13:26)
at node_modules/pug-walk/index.js:21:16
at Array.map (native)
at walkAST (node_modules/pug-walk/index.js:20:29)
at applyIncludes (node_modules/pug-linker/index.js:102:10)
at link (node_modules/pug-linker/index.js:21:9)
at compileBody (node_modules/pug/lib/index.js:84:11)
at Object.exports.compile (node_modules/pug/lib/index.js:164:16)
at handleTemplateCache (node_modules/pug/lib/index.js:137:25)
at Object.exports.renderFile (node_modules/pug/lib/index.js:331:10)
at Object.exports.renderFile (node_modules/pug/lib/index.js:321:21)
at View.exports.__express [as engine] (node_modules/pug/lib/index.js:368:11)
...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.