gpt4 book ai didi

html - 简单的 for 循环在 Jekyll 中不起作用

转载 作者:太空宇宙 更新时间:2023-11-03 17:50:49 25 4
gpt4 key购买 nike

我一辈子都想不通为什么这行不通...

<p>
{% for game in site.data.games %}
<span>{% game.name %}</span>
{% endfor %}
</P>

我收到这个错误:

 Liquid Exception: Unknown tag 'game' in games/index.html

并在 _data 文件夹中使用这个 .yml...

games:
- name: Game1
platforms: { win32, win64, linux64 }
distribution:
here: null
desura: http://www.desura.com/games/Game1
source: https://github.com/mygithub/Game1
description: cg/games/Game1/description.html
release: 2013-06-23

- name: Game2
platforms: {win32, win64, mac, linux32, linux64, android, ios, ouya, web}
distribution:
here: null
desura: null
steam: null
description: cg/games/Game2/description.html
release: 2015-Q1

最佳答案

语法不正确;

<span>{{ game.name }}</span>

关于html - 简单的 for 循环在 Jekyll 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25218314/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com