Closed nfriedly closed 9 years ago
Found it: my documents have an id
field, and that apparently throws off DocPad - if I add id: null
to the newDoc.setMeta
call, then the new document actually gets written!
I think this is actually a bug in DocPad core - if two docs can't have the same ID, then doc.clone()
/ docpad.cloneModel()
should remove the ID from the clone.
(I just deleted some of my comments because it was a silly tangent that distracted from the actual point.)
I'm importing documents from MongoDB and trying to send them to a second layout with this plugin. I poked around with the plugin, adding logging at various places, and for the most part it appears to be working correctly - it creates new docs, sets the
layout
,relativePath
, etc. But they never get rendered - I just get 404's in development and there's no trace of the extra files in the static output. There are no errors logged in a normal docpad run.The only thing I notice was that the new docs were keeping the
url
value from the old ones, but even after I modified the plugin to correct that, I still don't get rendered files.My source documents look like this:
And this is the relevant bits of my config:
This is the MongoDB plugin I'm using: https://github.com/nfriedly/docpad-plugin-mongodb
And, lastly, I'm on windows if that makes a difference. (Although I don't think it does - cloned this repo and ran the tests and they all passed.)
Any idea what's going on?