-
-
Notifications
You must be signed in to change notification settings - Fork 243
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
Added renderCollectionBefore and renderCollectionAfter events #608
Conversation
- v6.14.0 November 29, 2012 - Added `DocPad::getFileByUrl(url)` and updated the middleware router to use it - Big performance gain on request response time
…e` like the others
- v6.15.0 December 3, 2012 - [Nodejitsu](http://nodejitsu.com/) Support
- v6.16.0 December 4, 2012 - The amount of render passes is now customisable via the `renderPasses` configuration option, defaults to `1` - Increment this value dependening on how many levels of cross-document references you have (e.g. 2 passes for C includes B, B includes A) - The render pass functionality has been changed to render all documents that don't reference anything else first, then for each additional render pass, render documents that do reference others - Previously it would render both types of documents in the one batch, which resulted in hit and miss results - Doing this, we now safely have the default `renderPasses` value set to `1` which has the same effect as the traditional `2` render pass - Refer to [issue docpad#359](docpad#359) for more information
- Removed useless `Document::initialize` and `Document::getMeta` - Updated `File::getMeta` to create meta if it doesn't exist yet - Added `Base::setDefaults`, `File::setMeta`, and `File::setMetaDefaults`
- v6.17.0 December 4, 2012 - Updated - `File::getMeta` to create meta if it doesn't exist yet - Removed - `Document::initialize` didn't do anything - `Document::getMeta` didn't do anything - `File::readFile` merged into `File::parse` - `File::parseData` renamed to `File::parse` and cleaned signficantly - Added - `Base::setDefaults` to update attributes that haven't been set - `File::setMeta` to update the meta more easily than `File.getMeta().set` - `File::setMetaDefaults` to update the meta attributes that haven't been set - `File::getContent` to get the content or buffer - `File::getOutContent` to get the rendered content, or content, or buffer - `File::getStat` to get the stat - `File::setBuffer` to set the buffer - `File::getBuffer` to get the buffer
- v6.17.1 December 4, 2012 - Updated misc internals to use the new `File::getOutContent` call
- v6.17.2 December 5, 2012 - `watch` and `server` actions now perform an initial generation - Thanks [Khalid Jebbari](https://github.com/DjebbZ), [Vladislav Botvin](https://github.com/darrrk) - Closes [docpad#369](docpad#369), [docpad#368](docpad#368), [docpad#366](docpad#366)
Fixed loading of files ref docpad#370
- v6.17.3 December 5, 2012 - Fixed an issue introduced in v6.17.0 that prevented files from reloading under certain circumstances - Thanks [Vladislav Botvin](https://github.com/darrrk) for [issue docpad#370](docpad#370) and [pull request docpad#371](docpad#371)
- v6.18.0 December 14, 2012 - Added `regeneratePaths` configuration option - Include now returns expected results if the content hasn't been rendered yet - Closes [issue docpad#378](docpad#378) - Updated [QueryEngine](https://github.com/bevry/query-engine/) to v1.5.x from v1.4.x - [Backbone](http://backbonejs.org/) dependency now moved to our dependencies from QueryEngine's. Version set explicitly to v0.9.9. - If you have any plugins or whatever that used the `myCollection.getByCid` function, change that call to `myCollection.get` - Improved help URLs
- v6.19.0 December 15, 2012 - Renamed `ignorePatterns` configuration option to `ignoreCommonPatterns` and added new `ignoreCustomPatterns` configuration option - Updated dependencies - [bal-util](https://github.com/balupton/bal-util) from 1.14.x to ~1.15.2 - [watchr](https://github.com/bevry/watchr) from 2.1.x to ~2.2.1 - Updated optional dependencies - [mixpanel](https://github.com/carlsverre/mixpanel-node) from 0.0.9 to 0.0.10 - Updated dev dependencies - [chai](https://github.com/chaijs/chai) from 1.3.x to 1.4.x
- v6.20.0 December 17, 2012 - Better watch handling - Updated dependencies - [watchr](https://github.com/bevry/watchr) from ~2.2.1 to 2.3.x
variable name change
- v6.20.1 December 24, 2012 - Fixed `File::writeSource` - Thanks to [ashnur](https://github.com/ashnur) for [pull request docpad#381](docpad#381)
fixed missing progress option for loadFiles step
- v6.49.1 August 14, 2013 - `loadFiles` step is now properly reported in the progress bar - Thanks to [Bruno Heridet](https://github.com/Delapouite) for [pull request docpad#498](docpad#598)
- v6.49.2 August 20, 2013 - Fixed `File::deleteSource` - Plugin tester will now try to init the plugin test directory if there are tests defined (useful for plugins which tests start from scratch) - Updated dependencies
- v6.50.0 August 20, 2013 - Upgraded from commander v1.3 to v2 (removes commander prompts) - We now use promptly for prompts - Updated dependencies
…erenciate renderPass in plugins
Interesting. What is a plugin / use case that needs this? |
Yes, I found myself needing to create extras folders in the out directory only during the second pass when the collection to render contains specific documents. |
Let's keep |
Would you be able to do that rename of |
Yes, done. |
Sweet, will add it to the queue of things :) |
Seemed my rewrite to remove media from the repository is what caused all the duplicate commits. Seemed my deletion of Cherry-picked the changes into |
Released to v6.54.0 October 27, 2013 |
@balupton If you can tell me what these events do specifically I can add them to the documentation for you if you want. :) |
:) great, #608 (comment) is all I know about them |
@Delapouite Perhaps you could give me a little more insight so that I can give clear and concise info on the new events? |
Sure. DocPad has a renderPasses option : http://docpad.org/docs/config#available-configuration
So if you set this value to 3, you'll get 3 renderCollectionBefore/After events, one for each render pass. |
On the list of render events, where do they go exactly? Just so that I don't mess up the order. :) |
They are triggered between the usual renderBefore / renderAfter events : renderBefore |
Got it. Writing it in my branch of the documentation. Thanks! :) |
@Delapouite Pushed commit. Is that right? docpad-archive/documentation@42a2008 |
Hi
This PR adds a new before/after events couple.
The renderCollection events are triggered once per renderPass which lets plugins handle more granular action than the generic renderBefore / renderAfter events :
renderBefore
renderCollectionBefore (pass 1)
renderCollectionAfter (pass 1)
renderCollectionBefore (pass 2)
renderCollectionAfter (pass2)
[pass 3, 4 ... if enabled]
renderAfter