0

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.

Adam_G
  • 7,337
  • 20
  • 86
  • 148

1 Answers1

1

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.

irowe
  • 638
  • 11
  • 21
  • That seems to have significantly reduced the amount of error. But I still get ` 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'` – Adam_G Jun 05 '20 at 18:46
  • Hmm. Do you use any `when` tags in your source? That's a valid Liquid tag (like cases in a switch statement. Maybe there's a syntax problem with one of them. You could also consider running `bundle update` – irowe Jun 05 '20 at 19:07
  • Thanks! Which kinds of files would that be in? Html files? – Adam_G Jun 05 '20 at 21:15
  • Liquid tags are most often used in the html files in the `layouts/` folder – irowe Jun 05 '20 at 21:23
  • I searched for "when" within `_layouts/`. Nothing came up unfortunately. – Adam_G Jun 06 '20 at 22:07
  • Hmm. I'm not sure what else I can suggest. Have you tried any of the answers from this question? https://stackoverflow.com/questions/47565390/getting-an-unknown-tag-liquid-error-while-using-jekyll – irowe Jun 08 '20 at 13:56
  • I did try a bunch of stuff. Realistically I shouldn’t have tried to update ruby without fully understanding if. I ended up just rolling everything back. Your pointers definitely helped reduce the number of words, though. Thanks! – Adam_G Jun 08 '20 at 16:02