Closed xDarkicex closed 8 years ago
Can you show me not working parts of that template?
https://gist.github.com/xDarkicex/13204e6d61a8174d352641c4e4fe923b
The commented out parts are the broken Bits, I have included the render go code if I m=am doing this wrong.
Also how do you do a partial if I only have a include in a few pages I dont thing I can pass nil to funcmap deal
extends ../layouts/application.pug
block main-content
div.container-fluid
h1 New Post
//- include "_form.pug"
Here's a working example with includes
and extends
.
You can implement and attach other Funcs the same way.
If you uncomment an extends
in Gist/index.pug the blocks will work.
I had too add a "." to all my var from my object and my each in func didnt work but range did, seems your engine doesn't 100% convert jade too go templates I had to sort of mix and match the two to get it working properly.
At this moment the engine 100% converts from Jade to Go Template. So Javascript code works as is only if it's emulated on FuncMap, because Go Template does not support such constructions as each
, unless
, case
etc.
I see, I got it all figured out now thank you, now that I understand I see why the funcmap is needed, I might suggest covering custom functions in your example and or possibly mentioning it in the readme. Thank you for your time.
Ok, it's a good idea, thank you.
each is undefined, for is undefined when trying to do functions in pug template.