Merge remote-tracking branch 'notriddle/master'
This commit is contained in:
commit
f8150b496e
11
plugin.rb
11
plugin.rb
|
@ -246,10 +246,6 @@ SQL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
page_json = {
|
|
||||||
'@type' => 'QAPage',
|
|
||||||
'name' => topic&.title,
|
|
||||||
}
|
|
||||||
if accepted_answer = Post.find_by(id: topic.custom_fields["accepted_answer_post_id"])
|
if accepted_answer = Post.find_by(id: topic.custom_fields["accepted_answer_post_id"])
|
||||||
question_json[:acceptedAnswer] = {
|
question_json[:acceptedAnswer] = {
|
||||||
'@type' => 'Answer',
|
'@type' => 'Answer',
|
||||||
|
@ -266,10 +262,9 @@ SQL
|
||||||
|
|
||||||
['<script type="application/ld+json">', MultiJson.dump(
|
['<script type="application/ld+json">', MultiJson.dump(
|
||||||
'@context' => 'http://schema.org',
|
'@context' => 'http://schema.org',
|
||||||
'@graph' => [
|
'@type' => 'QAPage',
|
||||||
page_json,
|
'name' => topic&.title,
|
||||||
question_json,
|
'mainEntity' => question_json
|
||||||
]
|
|
||||||
).gsub("</", "<\\/").html_safe, '</script>'].join("")
|
).gsub("</", "<\\/").html_safe, '</script>'].join("")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue