Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect docpad configuration file support #883

Closed
dorajistyle opened this issue Sep 12, 2014 · 1 comment
Closed

Incorrect docpad configuration file support #883

dorajistyle opened this issue Sep 12, 2014 · 1 comment

Comments

@dorajistyle
Copy link

Hello,

I have a lot of categories then I want to generate collections with for loop.

Below code generate collections but it's empty.

I think @getCollection can not executed out of docpadConfig.

Anyone tried to generate defined collections from array in docpad.coffee?

categories = {
        ...
    'review': ['restaurant', ,'cafe', 'etc'],
    'IT': ['web','db','sccm','testing','blog','browser','linux','windows','3D','Java','mobile','tip','app','etc'],
}
docpadConfig = {
   ...
}
for main of categories
  docpadConfig.collections[main] = ->
    @getCollection("html").findAllLive
      relativeOutDirPath: main
    , [title: 1]

Want to back this issue? Place a bounty on it! We accept bounties via Bountysource.

@balupton
Copy link
Member

That for loop should probably be in an event somewhere... as the collections don't exist at that point

@balupton balupton changed the title How to generate defined collections in docpad.coffee? Incorrect docpad configuration file support Mar 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants