Open karneaud opened 7 years ago
I'm not sure what @Gottwik had in mind about making this more swappable, but I believe its pretty baked into using Handlebars atm
I like pugs. Pug is soft, cheerful and features ~wrinkles~ dead simple markup.
Pug may be used for template files and not to other enduro_admin-related things. Mainly pug api only needs a page context and api provided to it, and all the dynamics, component includes, filters etc. can be easily recreated via js and pug syntax in pug files.
I would nevermind if handlebars will still be used in enduro_admin and for custom components, but pug certainly will be a good addition :3
I guess the idea is to modularize enduro, so you would have extremely lightweight and fast core enduro and you would add enduro_pugs as a plugin. What do you guys think about that?
I think enduro is healthy and we shouldn't get stuck in the past. We will definitely get this done.
@Gottwik was looking at removing handlebars and using pug but from what I saw handlebars is pretty embedded...how can I remove it?
Currently there is no way to plug in custom code into enduro. So I guess the only way to do this is to fork enduro and add pugs.
The handlebars are touched only by a global variable enduro.templating_engine
. All you need to do is set it to pugs in https://github.com/Gottwik/Enduro/blob/master/libs/linker/linker.js#L33.
You'll need to wrap pugs functions to accept registerHelper
, compile
, compilesync
and SafeString
.
Compile
function returns function that returns a promise :-/ See what I mean here: https://github.com/Gottwik/Enduro/blob/master/libs/pregenerator/pregenerator.js#L47
Hey, let me know if I can help you with this in any way
Hey was anyone here able to do this? While I learning love handlebars more as I've been developing in Enduro, I still have a soft spot for Jade/Pug.
im also interested if pug and other custom template engines can be supported in enduro
If I wanted to add pugs markup to my project...how can I achieve this?