【发布时间】:2016-02-26 02:14:17
【问题描述】:
我正在使用Poole/Lanyon 构建一个网页。 A file 使用多级或嵌套的站点变量,例如 {{ site.github.repo }}。
作为 Ruby 和 YAML 的新手,我不确定应该如何在 _config.yml 中声明这个值。我在_config.yml中尝试过这样的:
github:
- repo: 'https://github.com/foo/bar.github.io'
它不起作用:当我使用 {{ site.github.repo }} 时返回一个空字符串。但是,我可以像这样得到{{ site.github }}:
{"repo"=>"https://github.com/foo/bar.github.io"}
为了使用site.github.repo,我应该如何在配置文件中定义这个变量?
【问题讨论】: