Why does liquid {%SEO%} tag not get integrated into head? instead it shows in body

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-25 01:40:08

问题


For some unknown reason any LIQUID syntax used inside <head> ends up in the <body>

What I have done?

1) I cloned a template and build my own layout with JEKYLL static site generator.
2) I installed all gems (check gemlist: 'jekyll-seo-tag' 'liquid 4.0')
3) I configured config.yml
4) I added {%SEO%} to <head>

Minimal

<head>

  <meta charset="utf-8">
  <meta name="author" content="Gino Ludikhuyze">
  <meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <!-- Title -->

  <title>title</title>

  <link rel="stylesheet" href="css/normalize.css">
  <link rel="stylesheet" href="style.css">
  <link rel="stylesheet" href="css/responsive.css">
  <script src="js/vendor/modernizr-2.8.3.min.js"></script>

  {% seo %}

</head>

What is happening?

If I render the website, online or local host, It shows a white GAP at the top. If I inspect it. It shows my liquid TAG in the body.

What I expect to happen?

That liquid should work in cohesion with jekyll.

Link to repo: https://github.com/bomengeduld/reno
Link to website: https://bomengeduld.github.io/reno/


回答1:


Your index.html should start with (empty frontmatter):

---
---

Otherwise the Liquid will not get rendered. That is all!



来源:https://stackoverflow.com/questions/49495210/why-does-liquid-seo-tag-not-get-integrated-into-head-instead-it-shows-in-bo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!