photogabble / eleventy-plugin-interlinker

Adds wikilink and wikilink embed support with tracking of backlinks.
https://photogabble.co.uk/projects/eleventyjs-interlink-plugin/
MIT License
17 stars 1 forks source link

BUGFIX: Fix crashing bug when embeded file changed while in `--watch` mode #56

Closed carbontwelve closed 6 months ago

carbontwelve commented 6 months ago

This PR fixes a bug raised in #33 by swapping out usage of EleventyRenderPlugin.RenderManager for EleventyRenderPlugin.String which is the exported template render function.

EleventyRenderPlugin.RenderManager ignores the templateConfig value passed to it, instead choosing to use its own internal state. When 11ty runs in --watch mode that internal state becomes different to what 11ty provides via its eleventy.config event. This is likely because the interlinker plugin is using RenderManager in a way its not intended to be used.

Fortunatly the compile function that RenderManager.compile wraps is also exported, however oddly named as String. This PR replaces usage of the render manager with usage of that compile function and should fix the crashing bug reported in #33.