Skip to content
Grav 2.0 is officially stable. Read the announcement →
Themes & Styling

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

Started by Joachim Liedtke 9 years ago · 2 replies · 1095 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 Sebadamus, 4 days ago
4 120 2 days ago
Themes & Styling · by martynfoster735, 7 days ago
1 176 6 days ago
Themes & Styling · by Justin Young, 3 weeks ago
1 232 3 weeks ago
Themes & Styling · by Slebeig, 1 month ago
4 364 1 month ago
Themes & Styling · by Pedro M, 3 months ago
4 730 3 months ago