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

Metadata won't come up as desired

Started by Muut Archive 11 years ago · 11 replies · 385 views
11 years ago

I have a problem with setting metadata in ..partials/metadata.html.twig.
I set http_equiv according to code but it comes as 'name' in result whatever I do.
There is also a line: <meta content="GravCMS 1.0.0-rc.2" /> that comes up from nowhere!
Please, help me!
It is certainly not a big issue but I cannot see the point yet.
I precised that I have looked at the forum on this subject before posting... there is something similar but not sufficiently clear to succeed.
Also in the documentation, the metadata exemple do not shows the http-equiv tag form.
Thanks in advance.

11 years ago

Actually scratch that, there is support! I'll test to ensure it's all working properly.

11 years ago

ok so supported? or not ?
where is GravCMS 1.0.0-rc.2 comes from?

11 years ago

yes, it is supported. I've updated the docs to reflect this.

I think the GravCMS is coming from a corrupted 'generator' tag. You override the generator tag with simply generator: "Your Custom Generator" in the metadata. Also added this to the docs.

11 years ago

ok thanks I feel better
what about http-equiv? why is it taken as name while it is not?
I would like to generate these 2 lines:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
how should I write?
Could you precise what is to be in system/site.yaml, user/site.yaml and user/pages/index.mdrespectively?
Is it just overwrite when present?
When you write 'corrupted' generator, how is it possible? Isn't it that it is made to be able to measure the audience of Grav (which I understand and respect: it's just that I 'd like to understand how http-equiv is not getting to its point ?
In avance, thanks.

11 years ago

In site.yaml

YAML
metadata:
    content-type: 'text/html; charset=UTF-8'

Although if your going to be setting this site-wide, your better off just hardcoding this in your base twig file. Why do that extra work?

Antimatter theme for example simply has this in the partials/base.html.twig:

TXT
<meta charset="utf-8" />

content-style-type is not supported, and I have no clue why you would ever need it, especially as your setting it to text/css which is the default and pretty much only option anyway.

11 years ago

thank you very much: i feel better.
I am a beginner in coding and so I am trying step by step...
Under, the reference from which I went that way:
recommendation of the W3C
Please, have a look and tell me what you think...

11 years ago

My recommendation is not to use content-style-type it's just a waste of bytes. There is zero benefit of it.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1346 9 years ago
Archive · by Muut Archive, 9 years ago
2 933 9 years ago
Archive · by Muut Archive, 9 years ago
2 4060 9 years ago
Archive · by Muut Archive, 9 years ago
1 2945 9 years ago
Archive · by Muut Archive, 9 years ago
3 1117 9 years ago