I found a documentation that explains the order of interpretation. The documentation is updated last on April 2020, and I’m curious if it is still valid.
The reason I am curious of the validity is because I think if the order explained on the documentation is correct, the code below should not be rendered correctly.
Here’s a simple layout file and a content file.
_layouts/my-layout.html
<!DOCTYPE html>
<html lang="ko">
<head>
<title>{{ page.title | append: " | " | append: site.title}}</title>
</head>
<body>
<p id="title">{{ page.title }}</p>
<div id="content">{{ content }}</div>
<style>
#title {
font-weight: bold;
font-size: 1.1em;
text-align: center;
padding-top: 1em;
padding-bottom: 1em;
background-color: lightsalmon;
}
#content {
padding: 1em;
background-color: lightgreen;
}
</style>
</body>
</html>
test.md
---
title: test page
layout: my-layout
---
This is a test page.
As you can see, the layout file is using liquid to print out the title of the page. According to the documentation, the order of interpreting liquid is prior to the one of merging layout file, so the title of the page({{ page.title }}
) should not be printed out.
However, when I tested the code, it worked as I wished. The title of the page is printed so nicely.
Is there anything I’m missing? Please help me.
Thank you in advance.