Content that fills itself in
A page's own details
Copy page
A page can show its own title, its date, its summary and its picture, without you typing any of them twice.
Why you would
You have already typed the title into the title field. Typing it again into a heading means two copies, and the day you rename the page only one of them changes.
The same goes for the date under an article, the summary in a lead paragraph, and the picture at the top.
What a page can show about itself
<h1>{{ page.title }}</h1>
<p class="lead">{{ page.excerpt }}</p>
<time datetime="{{ page.date }}">{{ page.date | date: "%e %B %Y" }}</time>
The fields are the same ones a list can read — see What a page knows about another page for all of them. The common ones:
| Field | What it is |
|---|---|
page.title |
The page’s title. |
page.date |
Its publication date — see Dates. |
page.excerpt |
The summary from its settings. |
page.url |
Its own address. |
page.image |
Its picture, or nothing. |
Its picture
Guard it, because a page without one has nothing there:
{% if page.image %}
<img src="{{ page.image.src }}" alt="{{ page.image.alt }}">
{% endif %}
About the site
The site itself has a few too, which is how a footer says your business name without it being typed into every page:
<footer>© {{ site.title }}</footer>
Your own facts
For anything that is not one of the fields above — your phone number, your opening hours — write it once, in the block that shows it on every page, usually the header or the footer. Change it there and every page changes with it.
On an item’s page
An item of a collection — an article, a portfolio
piece — has its own values too, as item.fields:
{% if item.fields.author %}
<p class="byline">By {{ item.fields.author }}</p>
{% endif %}
The rule of thumb
If the information is already somewhere in your dashboard, show it rather than retype it. A page’s own fields, an item’s fields, or — when you want information from other pages — a list.
You can just ask
“Put the publication date under the heading” is a request, not something you have to write. This page is here so you know it is possible and can read what the AI wrote.