erikw / jekyll-glossary_tooltip

Jekyll plugin providing a glossary liquid tag that will show a tooltip of a term definition.
https://erikw.github.io/jekyll-glossary_tooltip/
MIT License
26 stars 1 forks source link

Liquid syntax error: Unknown tag #2

Closed dtenenba closed 2 years ago

dtenenba commented 2 years ago

Hi,

I got your plugin to work using a trivial generated site (jekyll new mysite). So I know it works! But then I tried to get it to work with an existing Jekyll site and though I have triple checked that I did all the setup steps correctly, I am still getting this when I try and build the site:

/home/dtenenba/dev/wiki/vendor/bundle/ruby/2.7.0/gems/liquid-4.0.0/lib/liquid/document.rb:23:in `unknown_tag': Liquid syntax error (line 5): Unknown tag 'glossary' (Liquid::SyntaxError)

The line it is complaining about just has something like: bla bla {% glossary consideration %} bla bla and there is an entry for consideration in my _data/glossary.yml file.

I have added the gem to my Gemfile and run bundle install. I've added the plugin to my _config.yml. CSS is all set up. Not sure why I am still seeing this. Do you have any ideas of how I could go about troubleshooting this?

One thing that might matter, this site has a remote theme.

If you want to see the site, it's in this branch.

Thanks....

erikw commented 2 years ago

Hey,

I'll take a proper look tomorrow. Just one thing to check first that might be the problem. I think this gem should be listed in the :jekyll_plugins group in the Gemfile. I recall this is a group that has special meaning in Jekyll, as these are plugins loaded at compile time. In the linked repo, the gem is currently in the :development, :test groups in the Gemfile.

Check this minimal repo set up:

https://github.com/erikw/jekyll-4.x.x-test/blob/main/Gemfile#L19

dtenenba commented 2 years ago

Hey, that worked!

The site built and the glossary item rendered after doing this. Thanks!

) $ git diff
diff --git a/Gemfile b/Gemfile
index 464a6fc..3677c0a 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,9 +1,12 @@
 source 'http://rubygems.org'

+group :jekyll_plugins do
+  gem 'jekyll-glossary_tooltip'
+end
+
 group :development, :test do
 #   gem 'jekyll', '~> 3.8.3'
   gem "github-pages", group: :jekyll_plugins
-  gem 'jekyll-glossary_tooltip'
   gem 'jekyll-redirect-from', '~> 0.14.0'
   gem 'jekyll-sitemap', '~> 1.2.0'
   gem "nokogiri", ">= 1.10.4"
erikw commented 2 years ago

Oh great! =)