ginad
ginad

Reputation: 1973

Geddy swig template

Is it possible to use swig inheritance in geddy? When I'm looking at the code generated by geddy gen app app1 --swig, It looks like everything is like ejs but just changed it to {{ or {%.

Is there a documentation on how to use swig on Geddy or maybe an example.

Thanks

Upvotes: 0

Views: 99

Answers (2)

Paul Armstrong
Paul Armstrong

Reputation: 7156

A few issues:

  1. It looks like geddy has yet to update to support swig@>=1.0
  2. Geddy only supports the antiquated "layout/partials" style of rendering and does not allow for the template engines to set this up for themselves. There's an open issue at this time discussing these issues: https://github.com/mde/geddy/issues/436

Upvotes: 2

Ben
Ben

Reputation: 1302

What we have been doing with the other template engines is using the geddy partial helper function. This is more flexible than using the native subtemplate syntax that comes bundled with the template engines.

I was working on our Swig scaffolds a few months back and could not get partial to work with swig. I couldn't get it to pass the current rendering context to the sub-template, so all my variables were undefined.

This might have changed as Swig had a major update recently. If you have any luck, please let us know on GitHub or the mailing list so we can make the changes to our scaffolding code.

Here is an example of how partial is used in handlebars, note that this is used to pass the current rending context to the subview.

Here is the same thing done in jade, and again in ejs.

Upvotes: 0

Related Questions