Add data to your page
Working with front matters to add page data
The front matter can contain any variable that you want. For example, let's define a variable with the name title
:
---
layout: layout.njk
title: This is my website
---
# Welcome to my website
This if my first page using **Lume,**
a static site generator for Deno.
I hope you enjoy it.
This variable is accessible by the layout so that it can be inserted into the html code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{{ title }}</title>
</head>
<body>
{{ content | safe }}
</body>
</html>
The <title>
tag has the {{ title }}
placeholder used to insert the value of the variable title
.
Go to Page data documentation for more info about page data. {.tip}