node.js - Jade Include not working (on Extended template) -


simple question: i'm starting new small project have 1 jade file variables,1 jade file layout,1 jade file mixins , 1 file template.

when try use imported variables external file, aren't being loaded template, whereas mixins do.

when page1.jade processed, mixins imported correctly, layout extended correctly, variable styles.jade not imported (or seems) mixins unable reach variable stylecentermain assigned style attribute).

page1.jade:

include mixins.jade include styles.jade extends layout.jade  block append wholecontent     block append wholecontent     div.test1 hi world  block append wholecontent     div.test2 hi again  block append wholecontent        +modulemain()         p content pass mixin 

mixins.jade: (here error.)

mixin modulemain()   table(style=stylecentermain width="100%" height="100%")           

style.jade.

- stylecentermain ="margin-left: 0; margin-top: 0; margin-right: 0; margin-bottom: 0; padding-bottom: 0; padding-top: 0; padding-right: 0; padding-left: 0; vertical-align: top;" 

layout.jade (xml file):

<?xml version="1.0"?> doctype html      head              body         <!-- main content -->             div(style="background-color:#f2f4f5; margin:0 auto;")             block wholecontent               

can give hint of why style.jade not imported or why variable not accessed mixin?

thanks lot beforehand

first of included styles , named style check on that.

mixins way pass variable included script have receive it, have own scope!

if fix import name , should solve it:

mixins.jade

mixin modulemain(desiredstyle)   table(style=desiredstyle width="100%" height="100%")   

page1.jade

.... block append wholecontent    +modulemain(stylecentermain)     p content pass mixin 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -