Skip to content

Commit e8d8294

Browse files
committed
Add FAQPage structured data to the FAQ page for SEO
1 parent f2013f8 commit e8d8294

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

Diff for: _layouts/default.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE HTML>
2-
<html lang="en-US">
2+
<html lang="en-US" {{ page.html-meta }}>
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width,initial-scale=1">

Diff for: _sass/faq.scss

+6
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,10 @@
2828
}
2929
}
3030
}
31+
32+
.section-body {
33+
> :last-child {
34+
margin-bottom: 0;
35+
}
36+
}
3137
}

Diff for: faq.html

+6-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
title: CORS FAQ
44
permalink: /faq
55
css-class: faq
6+
html-meta: itemscope itemtype="https://schema.org/FAQPage"
67
---
78

89
<h1>CORS FAQ</h1>
@@ -29,11 +30,13 @@ <h1>CORS FAQ</h1>
2930
{% for file in collection.order %}
3031
{% for doc in collection.docs %}
3132
{% if doc.path contains file %}
32-
<section id="{{ doc.path | replace: "_faq/", "" | replace: ".md", "" }}">
33+
<section id="{{ doc.path | replace: "_faq/", "" | replace: ".md", "" }}" itemscope itemprop="mainEntity" itemtype="https://schema.org/Question">
3334
<h3>
34-
<a href="/faq#{{ doc.path | replace: "_faq/", "" | replace: ".md", "" }}">{{ doc.question }}</a>
35+
<a href="/faq#{{ doc.path | replace: "_faq/", "" | replace: ".md", "" }}"><span itemprop="name">{{ doc.question }}</span></a>
3536
</h3>
36-
{{ doc.content }}
37+
<div itemscope itemprop="acceptedAnswer" itemtype="https://schema.org/Answer">
38+
<div class="section-body" itemprop="text">{{ doc.content }}</div>
39+
</div>
3740
</section>
3841
{% endif %}
3942
{% endfor %}

0 commit comments

Comments
 (0)