Unit 02 · lesson
Liquid Objects
Liquid is Jekyll's template language.
The first part is the easiest to see: objects output values.
Object syntax
{{ page.title }}
The double braces mean:
evaluate this value and place its output here.
Later you will see tags using {% %} for control flow.
Do not mix the two jobs.
Guided page
Use:
---
title: About Me
role: Student Builder
---
<h1>{{ page.title }}</h1>
<p>{{ page.role }}</p>
Build and inspect generated HTML.
The browser should receive the values, not the Liquid source.
Missing values
Now reference:
{{ page.favorite_robot }}
without defining it.
Observe the result.
This may not produce a dramatic build error. Template systems often allow missing values to render blank or otherwise harmlessly depending on context.
That means successful build ≠ correct content.
Object chains
Objects can expose nested data.
You will eventually use forms such as:
{{ site.title }}
{{ page.url }}
{{ site.data.navigation }}
Read them left to right as scopes and properties.
Do not memorize every variable today.
Know where to look and what scope you are asking.
Inspect the generated source
For every Liquid object you add, prove:
Liquid source:
Resolved value:
Generated HTML:
If the value is wrong, inspect the data scope before rewriting surrounding HTML.
Portfolio action
Use page front matter to drive the heading and one visible metadata field on your About page.
Checkpoint
Explain the difference between:
{{ page.title }}
and:
<h1>About Me</h1>
Your answer should mention build-time variable resolution, not merely "one is Liquid."