Gottwik / Enduro

Minimalistic, lean & mean, node.js cms
http://www.endurojs.com/
MIT License
690 stars 120 forks source link

add pugs #93

Open karneaud opened 7 years ago

karneaud commented 7 years ago

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

justindra commented 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

CosmoMyzrailGorynych commented 7 years ago

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

Gottwik commented 7 years ago

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.

karneaud commented 7 years ago

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

Gottwik commented 7 years ago

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

rnlambert7 commented 6 years ago

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.

matthewjumpsoffbuildings commented 5 years ago

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