usnistgov / oar-pdr

The NIST Open Access to Research (OAR) Public Data Repository (PDR) system software
11 stars 10 forks source link

Embed schema.org metadata into landing pages #177

Closed RayPlante closed 3 years ago

RayPlante commented 3 years ago

This PR addresses ODD-931 ("schema.org") which calls for schema.org metadata (converted from NERDm) to be embedded into landing pages. This will enable our landing pages to be more readily discovered by Google Dataset. This implementation has been validated using Google's checker.

In this implementation, additional metadata formats can embedded into the landing page by list the format's label in the configuration parameter, embedmetadata. Currently, only one extra format is supported: "schema.org". The extra metadata renderings will appear within <script> elements within the <head> section of the HTML. (For consistency, the embeded NERDm metadata has been moved the <head> section as well, instead with the <body>.

To test under oar-docker, deploy branch feature/ODD-931-schema-org for the configserver container as well as for pubpdr. After building and launching, view the source for the landing pages, confirm the following:

chuanlin2018 commented 3 years ago

Screen Shot 2021-04-02 at 3 46 02 PM

I saw application/ld+json script in but no script in except Google Analytics. In the script in I only saw publisher. Didn't see url, name, creator, or maintainer.

Not sure if I understood your instruction correctly... The script also attached. SchemaOrgScript.txt