Skip to content
● Critical PHP security fixes are out: update PHP on your Grav sites. What to do →

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

Started by Joachim Liedtke 9 years ago · 2 replies · 1405 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 TomW, 2 days ago
0 55 2 days ago
Themes & Styling · by AH, 2 days ago
0 57 2 days ago
Themes & Styling · by FrViPofm, 1 month ago
4 590 4 weeks ago
Themes & Styling · by johan thomas, 5 years ago
1 899 1 month ago
Themes & Styling · by stuart young, 3 months ago
3 749 3 months ago