Can't use many "theme.*" liquid variable with remote theme
Describe the bug
When the site using remote theme, if trying to use some variables in "themes.*" an error is thrown:
Liquid Exception: undefined method `authors' for #<Jekyll::RemoteTheme::MockGemspec:0x000075fe6282baa0 @theme=#<Jekyll::RemoteTheme::Theme host="github.com" owner="sourlemonjuice" name="minima-for-sourlemonjuice" ref="HEAD" root="/tmp/jekyll-remote-theme-20241001-343013-3ugjua">, @path=nil, @dependency_names=[], @runtime_dependencies=[]> in pages/version.md
Error: undefined method `authors' for #<Jekyll::RemoteTheme::MockGemspec:0x000075fe6282baa0 @theme=#<Jekyll::RemoteTheme::Theme host="github.com" owner="sourlemonjuice" name="minima-for-sourlemonjuice" ref="HEAD" root="/tmp/jekyll-remote-theme-20241001-343013-3ugjua">, @path=nil, @dependency_names=[], @runtime_dependencies=[]>
Error: Run jekyll build --trace for more information.
The variable that go wrong are: authors, description, version, metadata
But these are no problem: root, dependencies
If the remote theme can't access this info. Then can it just warning or return a default value? Now it will break the whole build
Steps to reproduce the behavior
- find a site that uses remote theme
- put
{{ theme.authors }}into any page
Additional context
- Jekyll docs - Variables #Theme Variables
- Theme I'm using: https://github.com/SourLemonJuice/minima-for-SourLemonJuice
If you add {{ theme }} to a page - you will get " Jekyll::Drops::ThemeDrop ". So the theme variable, is not a collection/array, but rather an object.. This object is populated from the gemspec file, here: lib/jekyll/drops/theme_drop.rb, , but since jekyll core is not written to access the theme's .gemspec (in a remote sense) it falls back to an empty object content in line #35.
This is not a fix tho - it's a why. idk what the fix is, except having the plugin override the theme ThemeDrop object.