让我们考虑以下代码:
---
layout: post
title: "Welcome to Jekyll!"
test:
name: google.com
---
{{ post.test.name }}
{% assign addr="https://www.google.com" %}
# Heading
This is a link to [the Google homepage!][ghome]
This is another link that [may or maynot work][glink]
[ghome]: https://google.com
[glink]: {{ addr }}
它正确输出:
但是,当我尝试做同样的事情但更改addr
为test.addr
(并因此将其转换为 的数据成员时test
,链接会中断:
- 我如何使上述工作?
- 如何
page.test
向页面前面描述的变量添加新属性?