Html 访问集合文档中的自定义front matter变量
我的收藏中有一份Jekyll收藏文档Html 访问集合文档中的自定义front matter变量,html,jekyll,liquid,Html,Jekyll,Liquid,我的收藏中有一份Jekyll收藏文档编码: --- title: 'iOS iConify' rawname: iosiconify image: {{site.img}}/z-iosiconify.png layout: post link: https://iosiconify.github.io/ --- Hi! 我试图在html页面上呈现集合编码中的所有文档,我有以下代码: {% for post in site.coding %} <tr id="{{ post.
编码:
---
title: 'iOS iConify'
rawname: iosiconify
image: {{site.img}}/z-iosiconify.png
layout: post
link: https://iosiconify.github.io/
---
Hi!
我试图在html页面上呈现集合编码中的所有文档,我有以下代码:
{% for post in site.coding %}
<tr id="{{ post.rawname }}-desktop">
<td id="left">
<a href="{{ post.link }}" target="blank" id="{{ post.rawname }}-desktop-a">
<img src="{{ post.image }}">
</a>
</td>
<td id="right">
<h2>{{ post.title }}</h2>
<h4>{{ post.content }}</h4>
</td>
</tr>
{% endfor %}
你知道为什么定制的front matter变量都不起作用吗?我怎样才能让它们起作用?front matter中有一个错误,它阻止Jekyll正确处理它,只显示内容
这一行image:{{site.img}/z-iosiconify.png
应该是image:z-iosiconify.png
然后,当显示文档prependsite.img
时,如{{post.image | prepend:site.img}
。例如:
{% for post in site.coding %}
<tr id="{{ post.rawname }}-desktop">
<td id="left">
<a href="{{ post.link }}" target="blank" id="{{ post.rawname }}-desktop-a">
<img src="{{ post.image | prepend: site.img }}">
</a>
</td>
<td id="right">
<h2>{{ post.title }}</h2>
<h4>{{ post.content }}</h4>
</td>
</tr>
{% endfor %}
{%for post in site.coding%}
{{post.title}}
{{post.content}}
{%endfor%}
{% for post in site.coding %}
<tr id="{{ post.rawname }}-desktop">
<td id="left">
<a href="{{ post.link }}" target="blank" id="{{ post.rawname }}-desktop-a">
<img src="{{ post.image | prepend: site.img }}">
</a>
</td>
<td id="right">
<h2>{{ post.title }}</h2>
<h4>{{ post.content }}</h4>
</td>
</tr>
{% endfor %}