moudy / broccoli-taco

Static Sites Powered by Broccoli
http://broccoli-taco.com/
94 stars 14 forks source link

dynamic pages from root index are not merged properly #3

Open yourpalal opened 10 years ago

yourpalal commented 10 years ago

If you export an array of data from site/pages/data.js, the resulting pages are create in the wrong tmp directory, and then are not ever merged into the site.

A simple bugfix that works in my case is changing lib/broccoli-taco-handlebars.js:57 from dirname.substring(0, dirname.lastIndexOf('/')) to dirname

That said, I presume the substring stuff is in there for a reason, so something a bit more complicated might be needed.

Otherwise BT is pretty cool :)

moudy commented 10 years ago

@yourpalal thanks for the heads up. I didn't think about that case.

Unless I'm missing something it doesn't really make sense to return an array from the root index because there can only be 1 index (i.e. example.com). I need to document this.

If you want to dynamically create example.com/foo and example.com/bar you can create a nested page and return an array there. I added a test with an example here.

Does that make sense?

yourpalal commented 10 years ago

Ah okay, that makes sense. I had imagined that arrays would create children, not siblings.

I.e. example.com/baz/foo, example.com/baz/bar.

That makes sense. I guess the only thing I would want then is maybe an error message when you return an array from the index, and something in the documentation.

I was thinking I might try contributing to the project at some point, is there any documentation on how to get started with that? eg. how to run the tests, any code conventions/etc

moudy commented 10 years ago

Yeah I can see how that could be confusing. I'll add a warning soon.

Ideas/contributions wold be great! I updated the readme with some basic info https://github.com/moudy/broccoli-taco#contributing

givanse commented 9 years ago

Not sure if this is related, but the example here: http://broccoli-taco.com/documentation/#dynamic-pages Does not work. I lied, it works and I was being silly.