简体   繁体   中英

Using Liquid tags in a Jekyll page not working

I am attempting to setup a small blog using Jekyll. My work so far is as follows.

  • Setup a Github pages repository
  • Cloned the repo locally
  • Installed Ruby vs 2 and the sdk (windows)
  • Installed jekyll
  • 'serve' the local website.
  • Validated that I could view my website localhost:4000

Everything worked fine however the liquid syntax is not working as expected. All syntax is output as plane text. I am not sure how to continue. This error happens both locally as well as on my github hosted page.

Here is my index.html file

<!DOCTYPE html>
<html lang="en-us">
<head>
  {% include meta %}{{ site.time | date_to_xmlschema }}
</head>
<body>
  {% include header.html %}
  {% include header.html %}
  {% include header.html %}
  {% foo %}
  {{ foo }}

  <section class="main-content">
    {% include footer.html %}
  </section>
  {% include scripts.html %}
</body>
</html>

My _config.yml has foo defined. =(

If you want Jekyll to process your page, you must add a Front matter to your page ( see dedicated page in Jekyll documentation ).

The minimum front matter is an empty one. That means that your page will use default configuration for layout, etc ..

---
# this is an empty front matter
---
Your content here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM