Enduro icon indicating copy to clipboard operation
Enduro copied to clipboard

add pugs

Open karneaud opened this issue 7 years ago • 7 comments

If I wanted to add pugs markup to my project...how can I achieve this?

karneaud avatar Jul 20 '17 20:07 karneaud

I'm not sure what @Gottwik had in mind about making this more swappable, but I believe its pretty baked into using Handlebars atm

justindra avatar Jul 24 '17 06:07 justindra

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

CosmoMyzrailGorynych avatar Jul 25 '17 06:07 CosmoMyzrailGorynych

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 avatar Jul 31 '17 13:07 Gottwik

@Gottwik was looking at removing handlebars and using pug but from what I saw handlebars is pretty embedded...how can I remove it?

karneaud avatar Jul 31 '17 18:07 karneaud

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

Gottwik avatar Aug 01 '17 12:08 Gottwik

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.

rnlambert7 avatar Jan 13 '18 05:01 rnlambert7

im also interested if pug and other custom template engines can be supported in enduro