-
Notifications
You must be signed in to change notification settings - Fork 39
Implement google schema markup (only 2 questions added at the moment) #90
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔
There are some clear improvements that need to be made before this will be merged to production |
Seems this should just be rendered as part of the page. I'd look to add the question and answer as optional yaml frontmatter, then create a tag that pulls in that data and outputs the <script> with json content. You'll also want to consider expanding that schema tag to include some information about the top level Entity (the website) |
closing until I go trough some of the changes suggested by @johnpyp |
@Steven-Bonnell-II Is this something you want and are willing to maintain? I can't think of anything less I want to do than asking myself questions and writing them out about your philosophy content for every page you create. |
plz no bully https://youtu.be/iYRcPjKTKm8?list=PLFs19LVskfNzQLZkGG_zf6yfYTp_3v_e6&t=17181 If its too much work I can also try to write an algorithm to generate them: Example - philosophy My Foundational Beliefs However this approach would leave little room for customization and the result might not be satisfactory every time ... The safest way would be to handwrite each question. |
It's possible you could just have one set of questions/answers for every page on the site. It might not match up with the exact page that shows up in google results, but you don't have to constantly update it when you make new pages. (google might ding you for having questions/answers that they don't think match the specific page) |
yeah, for example having 4 questions / answers on philosophy 4 on politics, 1 on about etc... Would remove the massive workload
the way its made right now is that it only injects it in the specific page.
Right now it only works with philosophy questions, a new ID needs to be injected for each page when the questions are ready for said page. Google will only get the schema when it gets to /docs/philosophy |
I wrote a script that adds schema markup to the pages generated. Schema markup refers to this
Why is this useful?
Schema markup improves the SEO, it's basically code (semantic vocabulary) that you place on your website to help the search engines return more informative results for users.
I tested it using a ngrok server created from my local repo.
test can be done on https://search.google.com/test/rich-results
Right now it's only written for 2 items. You would probably want to review the text I wrote because it needs to be rephrased.
I will write the code for the next few, or extrapolate the one written for now.
Also please use Github Desktop.