You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
first thanks for making this nice plugin. I'm looking forward to #25!
I noticed as I migrated my website's build process to rake that this plugin does not work when building with Jekyll command ruby interface. It does work perfectly when building with the Jekyll shell command like $bundle exec jekyll build.
I built a minimal website showing off this problem here erikw/jekyll-3.x.x-test/ (linked branch: jekyll-git_metadata)
There are no build errors but silently there is no output for the variables the plugin provide e.g. {{ site.git.last_commit.short_sha }} will just render to an empty string. See the index.md. There is also no .git-metadata/ directory generated.
Note that if swapping the Jekyll::Commands::Build.proces() for the line under sh 'jekyll build' it all works perfectly and the git last commit short SHA is shown in the generated index.html.
What could the problem be here? Everything else works perfectly when using the ruby build interface for Jekyll, it's just this plugin that's troublesome for me, as shown in the minimal example repo I created.
Versions used can be seen in the example Gemfile /Gemfile.lock.
The text was updated successfully, but these errors were encountered:
erikw
changed the title
Not working when building with Jekyll Ruby interface from rake
Not working when building using Jekyll Ruby interface with Rake
Jul 12, 2021
Jekyll gives this particular group of gems in your Gemfile a different treatment. Any gem included in this group is loaded before Jekyll starts processing the rest of your source directory.
A gem included here will be activated even if its not explicitly listed under the plugins: key in your site’s config file.
Because of this, I never use the plugins key in the Jekyll _config.yml and just use the :jekyll_plugins group in the Gemfile, as seen in the minimal repo as well: Gemfile#L15-L18.
This works for all Jekyll plugins that I use, but not this one apparently as demonstrated in the minimal example I setup.
For me there is not a workaround. I'm not sure if I should leave this issue open though. If i understand the official Jekyll documentation correctly, the plugin should work still if only added to the build group but not set in the Jekyll configuration file. What do yo say @ivantsepp ?
Hey,
first thanks for making this nice plugin. I'm looking forward to #25!
I noticed as I migrated my website's build process to rake that this plugin does not work when building with Jekyll command ruby interface. It does work perfectly when building with the Jekyll shell command like
$bundle exec jekyll build
.I built a minimal website showing off this problem here erikw/jekyll-3.x.x-test/ (linked branch: jekyll-git_metadata)
The relevant snippet from the Rakefile would be:
There are no build errors but silently there is no output for the variables the plugin provide e.g.
{{ site.git.last_commit.short_sha }}
will just render to an empty string. See the index.md. There is also no.git-metadata/
directory generated.Note that if swapping the
Jekyll::Commands::Build.proces()
for the line undersh 'jekyll build'
it all works perfectly and the git last commit short SHA is shown in the generatedindex.html
.What could the problem be here? Everything else works perfectly when using the ruby build interface for Jekyll, it's just this plugin that's troublesome for me, as shown in the minimal example repo I created.
Versions used can be seen in the example Gemfile /Gemfile.lock.
The text was updated successfully, but these errors were encountered: