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

Metadata description not showing

Started by Muut Archive 10 years ago · 3 replies · 431 views
10 years ago

Hi there this is my first post, I found Grav really promissing and powerfull, excelent work!

Issue:

Following the tutorial for new theme , the metadata doesn´t show:

TWIG
{% if header.description %}
   <meta name="description" content="{{ header.description }}">
{% else %}
   <meta name="description" content="{{ site.description }}">
{% endif %}

But if I change

TXT
header.description 

with

TXT
page.header.metadata.description

it works.

TWIG
{% if page.header.metadata.description %}  
   <meta name="description" content="{{ page.header.metadata.description }}">
{% else %}   
   <meta name="description" content="{{ site.description }}"> 
{% endif %}

Is tutorial wrong or I'm missing something?

thanks!

10 years ago

Ah yes, the tutorial is out of date. We changed how metadata is stored quite a while ago. The tutorial clearly needs to be rewritten. Thanks for mentioning it. I'll add it to my list of things. Thanks.

10 years ago

BTW, best way to learn about themes is to look at existing ones. Antimatter is going to be the best supported one to use as a learning tool.

10 years ago

ok great! I'll keep that in mind, thanks!

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1359 9 years ago
Archive · by Muut Archive, 9 years ago
2 936 9 years ago
Archive · by Muut Archive, 9 years ago
2 4066 9 years ago
Archive · by Muut Archive, 9 years ago
1 2957 9 years ago
Archive · by Muut Archive, 9 years ago
3 1121 9 years ago