Let us consider the following code:
---
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 }}
It outputs properly:
However, when I try to do the same but change addr
to test.addr
(and thus convert it to a data-member of test
, the link breaks:
page.test
which is described in the front-matter of the page?Within a Page
, data flows in one direction.
Front Matter
=>
Content
You can do the following:
{% assign addr = page.test.name %}
[link][glink]
[glink]: {{ addr }}
But you can't do the following:
{% assign page.test.addr = "https://www.google.com" %}
[link][glink]
[glink]: {{ page.test.addr }}