Home > Software design >  liquid error error on build on github blog
liquid error error on build on github blog

Time:10-30

Error log

  Liquid Exception: Liquid syntax error (line 6): Unknown tag 'include_cached' in /_layouts/post.html

I am currently making a blog by forking this project at https://github.com/hydecorp/hydejack.
I've tried several methods for 2 days, but it doesn't work. Locally it's fine, but when I build I get an error.
this is my project
https://github.com/JangHwanPark/JangHwanPark.github.io

I tried changing config.yml and layout to md file. I also tried deleting the repository, but it didn't work.

CodePudding user response:

When you build the way you do, the "classic" way (as opposed to using an action), GitHub uses a fixed configuration and a list of whitelisted plugins (visible here). It really only includes the github-pages gem, which includes all other dependencies. Your Gemfile is ignored for the build; among other things, this means the build uses Jekyll v3.9.2, and not v4.1 as in your Gemfile.

There are two approaches:

  1. Stick with the "classic" experience. I recommend you make your local environment match that; the Gemfile simplifies to

    source "https://rubygems.org"
    
    gem "github-pages", "~> 227", group: :jekyll_plugins
    

    Don't forget to run bundle install after you've updated the Gemfile so the lockfile gets updated, too.

    You'll have to update _config.yml to include your theme via the remote-theme plugin, and add the include-cache plugin to the plugins list.

    This closely matches what the docs for your theme also recommend.

  2. Switch to a custom GitHub Actions flow to deploy your page. There is a starter workflow for Jekyll; using that should get you most of the way there. You might still have to specify remote_theme in the config instead of theme, unless you copy the entire theme into your repo.

    Doing this lets you use any gems you want, and any Jekyll version you want.

  • Related