Skip to content

Commit

Permalink
use meta ref
Browse files Browse the repository at this point in the history
  • Loading branch information
james-owen committed Jan 23, 2025
1 parent 3941ab3 commit 6f6be0f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function applyRenderHooks(ref, data, locals) {
* @param {Object} locals
* @returns {Function}
*/
function applyPostRenderHooks(ref, locals, res) {
function applyPostRenderHooks(ref, locals, res, self) {
return (html) => {

// skip postRender hooks in edit mode
Expand All @@ -50,7 +50,7 @@ function applyPostRenderHooks(ref, locals, res) {

return setup.plugins.filter((plugin) => plugin.postRender)
.reduce((val, plugin) => {
return plugin.postRender(ref, html, locals, res);
return plugin.postRender(ref, html, locals, res, self);
}, html);
};
}
Expand Down Expand Up @@ -148,7 +148,7 @@ function render(data, meta, res) {
return applyRenderHooks(state._layoutRef || state.self, data, state.locals)
.then(makeHtml(state))
.then(mediaService.injectScriptsAndStyles(state))
.then(applyPostRenderHooks(state._layoutRef || state.self, state.locals, res))
.then(applyPostRenderHooks(state._layoutRef || state.self, state.locals, res, meta._ref))
.then(result => {
res.type('text/html');
res.send(result);
Expand Down

0 comments on commit 6f6be0f

Please sign in to comment.