I’m unable to use the plugins specified in my theme.
Plugins can be specified in themes
Reading the theme docs I can see that plugins are inherited.
Jekyll themes specify plugins and package up assets, layouts, includes, and stylesheets
Example theme with plugin
I’ve made a simple example theme with a custom Liquid tag as a plugin (using the Jekyll docs tag example (/docs/plugins/tags/). It works perfectly when building the theme.
Example site using theme
But, I now want to use that theme (and inherit the plugin as well). I try to do so in this sample repo
But when I try to serve the site I get an error:
/Users/myname/.gem/ruby/2.7.0/gems/liquid-4.0.3/lib/liquid/document.rb:23:in `unknown_tag': Liquid syntax error (line 10): Unknown tag 'render_time' (Liquid::SyntaxError)
It is worth mentioning that I use Jekyll-remote-theme plugin
(I would have provided more links, but I’m not allowed to)
What am I doing wrong?
I would appreciate any help. Thank you.
I have no idea how I missed this before writing that question
Apparently it is the remote theme plugin that won’t support plugins.
I had the same issue not long ago.
I am using Remote Theme plugin to point to a theme and run on GH Pages.
I set the theme in config.
And I install the theme locally using the theme in Gemfile. (GH Pages ignores this file)
Because of using Remote Theme plugin, the installed theme is not actually used.
But… all the theme’s plugins get installed.
Note that in my project linked above I do not mention jekyll-sitemap etc. as a plugin in Gemfile. But I am still able to use them.
Here are my theme dependencies. If you look at my site you’ll see that there is a sitemap.xml created by the plugin.
Note there is no plugins key in my config.
A bit off topic.
Weirdly, if I setup another site with a minima theme built into GH Pages and not use Remote Theme, then I must add the sitemap and feed plugins in the config. But just these two.
And it only affects remote builds.
And the other plugins work fine without setting in plugins.