Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

setMetaDefaults doesn't work on the "write" document property #434

Open
iandoe opened this Issue · 3 comments

3 participants

@iandoe

Hello, i am currently trying to only render the index.html page in every of my directory, so by default set everything to write: false and set write: true manually only on the index files (the other files are fed to the index page via a for loop, so i don't need them in my final output directory), so i followed the example in the beginner guide and modified it this way:

collections:
          pages: ->
              @getCollection("html").findAllLive({isPage:true}).on "add", (model) ->
                  model.setMetaDefaults({ write: false })

But this isn't working and every file is getting written to the out/ directory.

Setting write:false manually does work tho. Any help ?

Docpad 6.21.10
npm 1.2.10
node v0.8.16


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

@balupton
Owner

Definitely sounds like a bug, for the meantime can you try model.setMeta({ write: false }) - does that work?

@iparr

@balupton I have exactly the same problem as @iandoe, although I can set other default meta values, for example, I'm using:

features: ->
    @getCollection("html").findAllLive({relativeOutDirPath: '_features'}).on "add", (model) ->
        model.setMeta({write: false})
        model.setMetaDefaults({menuHidden: true})

...which works fine. So thanks for the suggestion, but I'm not sure why and when to use setMeta instead of setMetaDefaults otherwise.

@balupton
Owner

May be fixed in v6.46.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.