Creation of structured FAQ
under review
K
Kruno Golubic
It would be great if there was an easy way to implement FAQs that contain structured data. This would allow creation of rich snippets for Google. https://developers.google.com/search/docs/advanced/structured-data/faqpage
John Reilly
I built a plugin to tackle this same issue. I've used it on my blog a few times and seen the SEO results show up in Google which is cool - take a look!
https://johnnyreilly.com/docusaurus-structured-data-faqs-mdx
R
Riza Farheen
John Reilly: hey this works fine. The doc got detected in the rich result tool.
Waiting to see the pages in Google Search
R
Riza Farheen
John Reilly: Any probable way to add code blocks in the FAQ answers? I tried by adding the <pre><code> tags.... like in HTML. It works in the UI, But the Google is detecting them as structured data with errors. Any help would be appreciated.
Joshua Chen
under review
This is certainly desirable for promoting good practices. The API is quite hard to design, but I'm in favor of making this available out-of-the-box.
John Reilly
Joshua Chen: some discussion on how this could be done here: https://fosstodon.org/@johnny_reilly/110269567059131928
I'm keen to help make it happen - I may benefit from a few pointers to get me going
John Reilly
Joshua Chen so I can see the TOC plugin exporting a headings variable here:
I can't work out where it's being consumed, and how. Maybe it's something to do with the MDX loader:
Do you know where the TOC is generated from the generated headings - my F12 skills are failing me!
John Reilly
I might have worked it out....
John Reilly
I've put together this:
It doesn't fully work and I'm not certain the design is amazing. Would be interested in people's thoughts. Maybe this isn't necessary.