docpad-plugin-jade icon indicating copy to clipboard operation
docpad-plugin-jade copied to clipboard

Properties from templateData and helpers are not copied to *this*

Open edzis opened this issue 12 years ago • 2 comments

I am defining some data in docpad config

templateData:
    site:
        navigation: [
            { href:'/#', label:'home' }
            { href:'/#what-we-do', label:'what we do' }
            { href:'/#clients', label:'clients' }
            { href:'/#blog', label:'blog' }
            { href:'/#contact', label:'contact' }
        ]

site is available in the scope of a page and template, but it is not a member of this. This raises problems when i am using partials plugin and passing the scope to it !=partial("sections/header.html.jade", this) At that moment the following evaluations result in false

hasOwnProperty('site')
hasOwnProperty('getFilesAtPath')

This is different to how it behaves on the default parser for .eco files. Where they evaluate to true and the same config variables are also accessed inside the partial.

edzis avatar Jul 30 '13 20:07 edzis

I'm plain not able to access any property in templateData from within the document - everything is undefined.

radiodario avatar Dec 09 '13 15:12 radiodario

Try out to use a jade mixin instead of the partial plugin, jade has this feature built-in

timaschew avatar Jan 15 '14 20:01 timaschew