Search code examples
rubygemsjekyllbundler

Trouble understanding multiple bundler/gem errors when serving site locally


I am trying to load my jekyll site locally, but get the errors below. I am unsure where to start, since there are so many errors.

(base) ➜  angoodkind.github.io git:(master) ✗ bundle exec jekyll serve
Configuration file: /Users/adamg/Dropbox/Website/github_io/angoodkind.github.io/_config.yml
            Source: /Users/adamg/Dropbox/Website/github_io/angoodkind.github.io
       Destination: /Users/adamg/Dropbox/Website/github_io/angoodkind.github.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
Error reading file /Users/adamg/Dropbox/Website/github_io/angoodkind.github.io/blog/index.html: (<unknown>): did not find expected key while parsing a block mapping at line 7 column 5
### ERROR REPEATED 9 TIMES ###
  Liquid Exception: Liquid syntax error (line 8): Unknown tag 'when' in vendor/cache/ruby/2.6.0/gems/liquid-4.0.0/lib/liquid/locales/en.yml
jekyll 3.5.2 | Error:  Liquid syntax error (line 8): Unknown tag 'when'

I have an index.html file both in my base directory, as well as in my blog/ subdirectory. Which file(s) should I look at? Any and all direction is greatly appreciated.


Solution

  • The file you should be looking at is blog/index.html. Any sort of parsing that Jekyll does of your HTML source is going to be looking at the YAML front matter or liquid tags (if you use them).

    You have incorrectly commented out the header photo in the front matter:

    ---
    layout: page
    title: Recent blog posts
    <!-- subtitle: Welcome to my winding road, under construction. -->
    use-site-title: true
    <!-- bigimg:
      - "/img/HomeImage.jpg" : "Somewhere in Wyoming (2010)" -->
    ---
    

    YAML comments are not the same as HTML comments. While this source file is an HTML filetype, the portion you are working with is YAML. According to this answer, comments in YAML use a single # symbol to start a comment that continues until the end of the line. There are no-multi line comments.