Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

How to add meta-tag with today's date?

Started by Joachim Liedtke 9 years ago · 2 replies · 1220 views
9 years ago

Hi all,

I'd like to add a meta-tag to my page-template that always displays the actual date, like this:

<meta name="date" content="Mon, 11 Sep 2017 17:22:44 +0200">

How would I achieve that? Any help is appreciated big time.

9 years ago

Add this code into your template:
<meta name="date" content="{{ now|date('r') }}">

9 years ago

Thank you so much for the enlightenment and I promise to dig deeper into the Twig documentation in the future.

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by stuart young, 1 month ago
3 451 1 month ago
Themes & Styling · by Sebadamus, 2 months ago
5 459 1 month ago
Themes & Styling · by martynfoster735, 2 months ago
1 445 2 months ago
Themes & Styling · by Justin Young, 2 months ago
1 468 2 months ago
Themes & Styling · by Slebeig, 3 months ago
4 599 3 months ago