Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

W3C Validator {% block meta %} #88

Open
aurelien-huet opened this issue May 30, 2023 · 3 comments
Open

W3C Validator {% block meta %} #88

aurelien-huet opened this issue May 30, 2023 · 3 comments

Comments

@aurelien-huet
Copy link
Contributor

The following code is not a valid HTML. You can see screenshot where the W3C validator trigger errors.

{% block meta %}
<meta itemprop="url" content="{{ object.get_meta_url }}">
<meta itemprop="name" content="{{ object.get_meta_title }}">
<meta itemprop="description" content="{{ object.get_meta_description }}">
{% if meta_image %}<meta itemprop="image" content="{{meta_image}}">{% endif %}

<title>{{ object.get_object_title }}</title>
<meta name="description" content="{{ object.get_meta_description }}">
{% endblock meta %}
error-w3c-validator
@seb-b
Copy link
Member

seb-b commented May 30, 2023

yeah this might be an outdated way to reference these things, I believe the correct syntax is something like
<meta name="description" content="description goes here">

@seb-b
Copy link
Member

seb-b commented May 30, 2023

No that's not right, these are valid tags, they're for schema.org validation. To fix this you should add an itemscope and a relevant itemType to your head element e.g.

<head itemscope itemtype="https://schema.org/WebPage">
  {% meta_tags %}
 </head>

This could be better explained in the readme

@aurelien-huet
Copy link
Contributor Author

You're right @seb-b 👍 , it's ok but need documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants