为什么液体{%SEO%}标签没有集成到头部?相反,它显示在体内 [英] Why does liquid {%SEO%} tag not get integrated into head? instead it shows in body

查看:50
本文介绍了为什么液体{%SEO%}标签没有集成到头部?相反,它显示在体内的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某些未知原因,<head>内部使用的任何LIQUID语法最终都出现在<body>

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

我做了什么?

1)我克隆了一个模板,并使用JEKYLL静态网站生成器构建了自己的布局.
2)我安装了所有宝石(请检查宝石列表:'jekyll-seo-tag' 'liquid 4.0')
3)我配置了config.yml
4)我在<head>

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>

最低

<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>

发生了什么事?

如果我渲染网站(在线或本地托管商),则其顶部会显示白色的GAP.如果我检查它.它显示了我体内的液体TAG.

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.

我期望发生什么?

该液体应与jekyll结合使用.

That liquid should work in cohesion with jekyll.

回购链接: https://github.com/bomengeduld/reno
链接到网站: https://bomengeduld.github.io/reno/

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

推荐答案

您的index.html应该以(空的前题)开头:

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

---
---

否则,液体将不会被渲染.仅此而已!

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

这篇关于为什么液体{%SEO%}标签没有集成到头部?相反,它显示在体内的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆