sugarlabs / musicblocks

Music Blocks -- A musical microworld
https://musicblocks.sugarlabs.org/
GNU Affero General Public License v3.0
568 stars 764 forks source link

Featured Image, Project Name, and Short Description for Search Engines, etc. #2869

Closed pikurasa closed 1 year ago

pikurasa commented 3 years ago

Music Blocks links are beginning to get captured by search engines. Also, linking to MB projects in apps such as matrix will grab some important data that we are not yet making available.

I do not know the technical terminology, but what we seem to need is:

  1. Featured Image
  2. Project Name
  3. Short Description

Otherwise, linking to MB--either from a search engine or an app will look like Screenshot at 2021-03-05 20:25:09

alfredhb commented 3 years ago

Taking a look at this for a school project. I've found that OGP is used by search engines and fb / whatsapp for serving image, name, description etc.

Adding these would involve injecting some HTML objects into the project pages themselves. I'll work on this and make a pr for it

alfredhb commented 3 years ago

After research and some fiddling, I've concluded that this isn't possible without extreme structural refactoring. Facebook and other crawlers don't allow meta tags (which is what provide the desired data) to be updated dynamically i.e. through js and can only pull from static HTML pages. This would mean that in order to get the desired data from a shared MB link, that link would need to point to a prerendered HTML page and not just the index.html of the site.

So in short, unless MB projects are prerendered individually as HTML pages, this sort of information display isn't possible