www-from-model/layouts/_partials/extend-head.html
Stephan Heunis 01540154a4
All checks were successful
Deploy on webserver / Build site and deploy on success (push) Successful in 3m31s
Use extend-head partial to inject dataset.json if available
This is for a demo. The idea is to:
- search for a dataset.json file in a bundle
- if found, assume it is a json-ld document describing a Dataset object
  that is compliant with schema.org and google dataset search's requirements
- inject the file content into the correct script tag in the html page head

This should be the necessary steps to allow the page to be indexed by Google
dataset search.

This does not distinguish yet between different schema.org classes. It is
for a dataset demo, specifically the studyforrest phase 2 dataset, which has
received a handcrafted json-ld document in it's bundle
2026-06-16 22:45:20 +02:00

7 lines
No EOL
178 B
HTML

{{ if eq .Kind "term" }}
{{ with .Resources.GetMatch "dataset.json" }}
<script type="application/ld+json">
{{ .Content | safeJS }}
</script>
{{ end }}
{{ end }}