compose_landing_page_jsonld#
- documenteer.citations.compose_landing_page_jsonld(citations, *, site_url=None)#
Compose a site’s citations as a schema.org JSON-LD document, serialized ready to embed in a
<script type="application/ld+json">element.- Parameters:
- Returns:
The serialized JSON-LD document, or
Nonewhen there are no citations — a site that declares none emits no block at all.- Return type:
Notes
The self citation is the document’s own subject rather than one node among several: this page is that DOI’s landing page, so a consumer reading the document top-level finds the DOI it came for, and the site’s other citations hang off it as schema.org
citationvalues. A site that declares citations but marks none of themselfhas no such subject, and its citations are emitted as a plain@graphinstead.The returned string is safe to place directly in a
<script>element: the characters that could close it early are written as JSON string escapes (see_SCRIPT_ESCAPES), so a title containing</script>, quotes, or ampersands cannot break out of the block.