srid / zulip-archive

Zulip Archive viewer (statically generated HTML)
https://funprog.srid.ca
13 stars 1 forks source link

Add Structured Markup to Pages #11

Open prikhi opened 4 years ago

prikhi commented 4 years ago

This would help display posts as rich results in search result pages: https://developers.google.com/search/docs/guides/intro-structured-data https://schema.org/docs/schemas.html

The few relevant types I can think of:

srid commented 4 years ago

There is also The Open Graph protocol that is involved in "link previews" generated by the likes of Twitter, Slack, etc. I already use this for my website.

prikhi commented 4 years ago

Yup, the spec is here: https://ogp.me/ along with some validators at the bottom of the page.

Probably the most important to add for topics are:

prikhi commented 4 years ago

I might do the breadcrumbs soon. Do you have a preference of RDFa or Microdata? I usually do microdata but both are easy to implement.

Do you think I should move the SEO stuff like structured attributes & OGP stuff to another module like SEO.hs or just keep it all in Main?

srid commented 4 years ago

I might do the breadcrumbs soon.

Nice!

Do you have a preference of RDFa or Microdata? I usually do microdata but both are easy to implement.

I never heard of them before, and as such have no preference either way. :-) In Wikipedia, it seems to indicate that RDFa Lite is an "unique and definitive standard alternative to Microdata" - but I don't know the primacy of that in the larger context.

Do you think I should move the SEO stuff like structured attributes & OGP stuff to another module like SEO.hs or just keep it all in Main?

I guess separate module as long as things are DRY.

You might also want to consider creating data types (example) to hold the SEO data, so that the construction of them (example) is decoupled from their rendering (example). This way you can put the data type and the rendering function in SEO.hs, but keep the function that constructs them close to Main.hs.