Missing Hook 'page:after'
rahul286 opened this issue · 3 comments
We are using hook 'page:after' in our code for gitbook plugin - https://www.npmjs.com/package/gitbook-plugin-edit-link
It seems the hook we were using is removed.
Hook 'page:after' 'used by plugin 'gitbook-plugin-edit-link' has been removed or is deprecated
Sorry if I missed related announcement or documentation. Is this replaced by new hook?
I tried page:before
and only page
but both gave similar error. Can you please suggest alternative?
Hi @leesei ,
but what if you want to modify the page itself, without adding any tags? The edit-link plugin adds some navigation to the page layout. I am using this hook in plugin image-captions to add figcaption to the images. There is no need of any custom tag, just a possibility to modify already rendered page. Adding custom tag would mean unnecessary work for users without any real benefit.
Thanks, Tomas
I see. I was answering generally to why the warning is shown and the official alternative, not to some specific use case.
I agree to your concern and that could be another issue discussing the merits of the change and whether template blocks can really replace page hooks. I also think the change was not properly announced and discussed among the community.
For the two mentioned plugins:
image-caption could be rewritten as template blocks.
I don't have a solution for edit-link, I have yet to look into GitBook 2.x source to look for alternatives.