2

I'm working in a node/wintersmith/jade stack and am attempting to loop through a series of markdown files and pull out metadata to create dynamic file paths. I've read Use a variable in a Jade include and realize that dynamic includes isn't possible in Jade but I'm curious if anyone has found any work around, I don't feel like the answers presented in the other post are appropriate.

- var people = _.chain(contents['people']._.pages, function(item) {
-   return item
- }).value()
      dl
      each person in people
          - var bio = "assets/bio/" + person.metadata.bio
          dt
              != person.html
          dd
              include:md bio
Community
  • 1
  • 1
presswanders
  • 655
  • 6
  • 8
  • 3
    [This appears to be a common feature request on Jade's Github too.](https://github.com/jadejs/jade/issues/1312) [Latest word is Jade 2.0 might have this](https://github.com/jadejs/jade/issues/1312#issuecomment-70817811) – laggingreflex Jan 29 '15 at 23:17
  • 1
    In [nunjucks templating engine](https://github.com/jbuck/wintersmith-nunjucks) this problem seems to be solved already (https://github.com/mozilla/nunjucks/issues/7) – xmojmr Jan 30 '15 at 07:35

0 Answers0