Skip to content

Commit 496d019

Browse files
committedAug 9, 2019
Fix site.url in Organization/Person JSON-LD schema
Close mmistakes#1906
1 parent 02f6304 commit 496d019

File tree

3 files changed

+16
-20
lines changed

3 files changed

+16
-20
lines changed
 

‎CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
### Bug Fixes
99

10+
- Fix `site.url` in Organization/Person JSON-LD schema. [#1906](https://github.com/mmistakes/minimal-mistakes/issues/1906)
1011
- Remove full stop in some `comment_form_info` UI text strings. [#2220](https://github.com/mmistakes/minimal-mistakes/pull/2220)
1112
- Fix default `site.author` in seo.html [#2230](https://github.com/mmistakes/minimal-mistakes/pull/2230)
1213
- Fix overlapping links (linked to and post's permalink) in post link type. [#2222](https://github.com/mmistakes/minimal-mistakes/issues/2222)

‎_includes/seo.html

+13-20
Original file line numberDiff line numberDiff line change
@@ -127,28 +127,21 @@
127127
<link rel="next" href="{{ paginator.next_page_path | absolute_url }}">
128128
{% endif %}
129129

130-
{% if site.og_image %}
131-
<script type="application/ld+json">
132-
{
133-
"@context": "https://schema.org",
130+
<script type="application/ld+json">
131+
{
132+
"@context": "https://schema.org",
133+
{% if site.social.type == "Organization" %}
134134
"@type": "Organization",
135-
"url": {{ '/' | absolute_url | jsonify }},
136-
"logo": {{ site_og_image | jsonify }}
137-
}
138-
</script>
139-
{% endif %}
140-
141-
{% if site.social %}
142-
<script type="application/ld+json">
143-
{
144-
"@context": "https://schema.org",
145-
"@type": "{% if site.social.type %}{{ site.social.type }}{% else %}Person{% endif %}",
135+
"url": {{ '/' | absolute_url | jsonify }}{% if site.og_image %},
136+
"logo": {{ site_og_image | jsonify }}{% endif %}
137+
{% else %}
138+
"@type": "Person",
146139
"name": {{ site.social.name | default: site.name | jsonify }},
147-
"url": {{ seo_url | jsonify }},
148-
"sameAs": {{ site.social.links | jsonify }}
149-
}
150-
</script>
151-
{% endif %}
140+
"url": {{ '/' | absolute_url |jsonify }}{% if site.social.links %},
141+
"sameAs": {{ site.social.links | jsonify }}{% endif %}
142+
{% endif %}
143+
}
144+
</script>
152145

153146
{% if site.google_site_verification %}
154147
<meta name="google-site-verification" content="{{ site.google_site_verification }}" />

‎test/_config.yml

+2
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ social:
8484
type : # Person or Organization (defaults to Person)
8585
name : # If the user or organization name differs from the site's name
8686
links: # An array of links to social media profiles
87+
- https://twitter.com/
88+
- https://github.com/
8789

8890
# Analytics
8991
analytics:

0 commit comments

Comments
 (0)
Please sign in to comment.