ropensci / roweb3

rOpenSci website source
https://ropensci.org
20 stars 54 forks source link

Should we add JSON-LD to pages #5

Closed maelle closed 2 years ago

maelle commented 4 years ago

To help with SEO? Cc @cboettig

Cf e.g. https://www.fabian-keller.de/blog/adding-json-ld-to-a-personal-website/

Hugo Academic theme does that a bit (for the website homepage, for blog posts) https://github.com/gcushen/hugo-academic/search?q=schema&unscoped_q=schema

maelle commented 4 years ago

I don't think it'd take much time to do that, and a tech note could mention that + the jsonld package + some beginner facts about JSON-LD (I am a total JSON-LD newbie).

maelle commented 4 years ago

https://moz.com/blog/json-ld-for-beginners

https://developers.google.com/search/docs/guides/intro-structured-data

maelle commented 4 years ago

https://support.google.com/webmasters/answer/7445569 (although blog posts aren't a supported type yet)

maelle commented 4 years ago

There's an internal Hugo schema template so in the new website layouts I've added

{{ template "_internal/schema.html" . }}

to the head partial which can't heart.

It doesn't generate that in a script though, it's as metadata. E.g. for a recent post of @stefaniebutland's in the head there's

 <meta itemprop="name" content="2 Months in 2 Minutes - rOpenSci News, June 2020">
<meta itemprop="description" content="Semi-monthly summary of the rOpenSci Newsletter, June 2020">
<meta itemprop="datePublished" content="2020-06-18T00:00:00&#43;00:00" />
<meta itemprop="dateModified" content="2020-06-18T00:00:00&#43;00:00" />
<meta itemprop="wordCount" content="502">

<meta itemprop="keywords" content="newsletter,r,hugo,auk,bib2df,bomrang,clifro,crul,drake,handlr,magick,piggyback,Rclean,RefManageR,rflybase,rnaturalearth,rsvg2,tidyhydat,tradestatistics," />

A more involved approach https://dev.to/pdwarkanath/adding-structured-data-to-your-hugo-site-58db -- noting this here but I won't work on this in the short term.