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

Show custom meta data on page content

Started by Natalia Bazilenco 4 years ago · 3 replies · 696 views
4 years ago

Hi, I added a custom meta data on configuration page - slogan-
And now I try to show the slogan on home page after site title.
i try different options

TWIG
<h3>{{ site.slogan.meta }}</h3>
<h3>{{ site.slogan}}</h3>
<h3>{{ site.meta.slogan }}</h3>

but doesnt work. Can you help me please.

4 years ago

@NataliaB, You question would be more informative if you could share the slogan section in /user/config/site.yaml

4 years ago
YAML
metadata:
  description: 'short text about my company'
  slogan: 'We r the best'
3 years ago

I think you should concatenate site title with page metadata. For example:

TWIG
<h3>{{ site.title|e('html') }} - {{ page.metadata.slogan|raw }}</h3>

Suggested topics

Topic Participants Replies Views Activity
Support · by stell, 7 days ago
5 243 1 hour ago
Support · by gravinator, 1 month ago
5 458 3 hours ago
Support · by Gravver, 2 weeks ago
6 280 1 week ago
Support · by Marcel, 4 weeks ago
2 338 1 week ago
Support · by blu3prince, 2 weeks ago
1 255 2 weeks ago