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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Themes & Styling

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

Started by Joachim Liedtke 9 years ago · 2 replies · 897 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 Pedro M, 2 months ago
4 196 2 months ago
Themes & Styling · by Ian, 2 months ago
3 92 2 months ago
Themes & Styling · by Norbert, 2 years ago
11 454 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 47 3 months ago
Themes & Styling · by Sebadamus, 4 months ago
5 126 3 months ago