Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

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

Started by Joachim Liedtke 9 years ago · 2 replies · 1303 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 FrViPofm, 2 weeks ago
4 407 7 days ago
Themes & Styling · by johan thomas, 5 years ago
1 760 2 weeks ago
Themes & Styling · by stuart young, 2 months ago
3 617 2 months ago
Themes & Styling · by Sebadamus, 2 months ago
5 625 2 months ago
Themes & Styling · by martynfoster735, 2 months ago
1 600 2 months ago