Skip to content

missing trailing slash in structured data #1906

Closed
@chatoo2412

Description

Environment

Expected behavior

Structured data don't contain trailing slashes, unlike canonical URL does.
Strictly speaking, paths with and without trailing slashes are different.
Please make it consistent.

Steps to reproduce the behavior

{% if site.og_image %}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Organization",
"url": {{ seo_url | jsonify }},
"logo": {{ site_og_image | jsonify }}
}
</script>
{% endif %}
{% if site.social %}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "{% if site.social.type %}{{ site.social.type }}{% else %}Person{% endif %}",
"name": {{ site.social.name | default: site.name | jsonify }},
"url": {{ seo_url | jsonify }},
"sameAs": {{ site.social.links | jsonify }}
}
</script>
{% endif %}

{%- assign seo_url = site.url | append: site.baseurl -%}

{%- assign canonical_url = page.url | replace: "index.html", "" | absolute_url %}

seo_url doesn't contain trailing slash but canonical_url does contain.

Other

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions