Easy question about Liquid tag error on a page

Hi everyone!

I’ve been trying all day to solve an error I’m getting while locally serving my Jekyll site due to a new plugin. I want to use this plugin, which should post statistics on one’s site with respect to number of words and whatnot. However, I must be missing something completely obvious, because when I try to add it to any one of my pages (such as my about.md page), I keep getting the following error:

“Liquid syntax error: unknown tag ‘content_statistics’”

I was hoping someone could point out where I’m obviously going wrong. I thought that one would need to simply insert the required tag, {% content_statistics %}, into either a Markdown page or on some other page, and it would output the result. However, I keep getting this error while trying to build locally. I have the .rb file in my _plugins folder, and I thought that was all I had to do. Obviously, I’m missing something. If anyone has any idea, please let me know.

Sounds like you need to drop that tag into a template, not a Markdown page.

Try adding it to one of your _layouts and see if that works.

Just tried that by throwing it in my default layout, but I’m getting the same error. I imagine it should work, so I don’t quite know what’s up here. Do you have any other suggestions?

Don’t think you’ve done anything wrong. It’s likely the plugin. Maybe reach out to the developer?

Their post is 3 years old. Entirely possible their plugin is broken and doesn’t work with current versions of Jekyll.

Alright, thanks. I’ll reach out to the developer, but the odd thing is that I’ve also tried this one, and the same error occurred. This makes it seem like perhaps I’m doing something wrong.

Hopefully the developer will have a suggestion.

The plugin looks like a simple piece of code… and Jekyll’s Tag-loading API hasn’t changed that much at all… In theory, everything should work fine.

The only thing that could cause issues here is the safe flag…

Make sure none of the following is true in your case.

  • You are not running jekyll build --safe
  • There is no safe: true in your _config.yml
  • You are not using the github-pages gem instead of jekyll in your Gemfile.

Thank you very much for your response, it solved my issue! Of course, the last item that you listed was something I did have in my Gemfile, but once I removed it everything worked again. Now I just have to figure out how to push my site to Github Pages after building it locally (which I know there’s documentation for).

Thanks again for the help!

1 Like

I’m having the exact same problem than C-Jeremy, but in my case I’m sure I:

  • am not running jekyll build --safe
  • don’t have safe: true on my _config.yml file
  • am not using the github-pages gem instead of jekyll

When I run jekyll serve it works as expected, but when running jekyll build it generates the files as if --safe was specified.

Any ideas?

Edit: I’ve my jekyll project publicly uploaded to gitlab and the project at gitlab pages (the problem is with the TextFilters liquid filter, which is not properly generating the /tags html file, which uses the urlize function from the TextFilters filter).