v2.5.1 - update plugin for 6.82.x line of DocPad #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We've been trying to update some sites to use the 6.82.x line of DocPad and encountered difficulties with the Handlebars plug-in where it wasn't passing in the helpers or partials defined in our
docpad.jsfile.I traced the errors and confirmed that they were present in this plug-in when using the 6.82.x line (tests failing with the same error log of missing helpers / partials).
This PR fixes the plug-in for the 6.82.x line by moving the call to
super(config)from the bottom to the top of the plug-in's ownsetConfigmethod. This appears necessary to properly initialize the plug-in config to add the helpers and partials before the plugin tries to process them.I'm far from an expert on Docpad's plugin architecture so this fix is at the level of "tests pass again, and fixes the problem for our sites", so please let me know if there's a better way to address this. I'm guessing the issue I've seen is related to this change to
docpad-basepluginthat changes how config merging is handled: https://github.com/docpad/docpad-baseplugin/blob/master/HISTORY.md#v103-2018-september-7