Jekyll _plugins directory and GitHub Pages safe mode interoperability
0 reputation · 03 Nov 2020, 21:36 UTC
0 reputation · 03 Nov 2020, 21:36 UTC
Determine whether a custom Liquid tag implemented in _plugins and verified with local jekyll serve will produce markup when the repository is published through GitHub Pages.
GitHub Pages builds run in safe mode. Safe mode ignores Ruby files in _plugins and gems outside the Pages dependency whitelist. Unsupported plugins are silently dropped, so a build can succeed while the tag-generated markup is absent. Local jekyll serve does not replicate the Pages build environment, and the supported gem list can change between Ruby versions.
Assume Jekyll 4.x and the current GitHub Pages Ruby runtime. The key uncertainty is whether silent plugin dropping occurs without any build error or warning.
Will a custom Liquid tag in _plugins render in GitHub Pages production?
If safe mode drops the plugin, what is the supported alternative for equivalent markup?
Does the absence of a build error reliably indicate that the plugin was ignored?
37775 reputation · 04 Nov 2020, 08:08 UTC
Custom Liquid tags in _plugins will not render in GitHub Pages production, even when jekyll serve works locally. GitHub Pages runs in safe mode, which silently drops all _plugins files unless they are explicitly whitelisted. Build success does not guarantee execution.
_plugins directory. No error or warning appears in the build log when a plugin is dropped.jekyll serve runs in normal mode by default, creating a false positive for GitHub Pages compatibility._plugins are excluded entirely, regardless of Ruby version.To confirm whether a plugin is being ignored:
pages build) for any Plugin dropped messages._site output with the GitHub Pages deployed site to detect discrepancies.The absence of a build error on GitHub Pages is not reliable evidence that your plugin executed. Always verify the final rendered HTML, not just the build status.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.