Skip to content

Commit

Permalink
entity-renderer: expose jsonld string to the view
Browse files Browse the repository at this point in the history
  • Loading branch information
ludovicm67 committed Sep 24, 2024
1 parent 0ffbab0 commit c1295d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/cyan-laws-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@zazuko/trifid-entity-renderer": minor
---

Expose `jsonld` string to the view, so that some complex logic could be done on top of it if needed.
2 changes: 2 additions & 0 deletions packages/entity-renderer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,14 @@ const factory = async (trifid) => {
},
)
const metadata = await metadataProvider(request, { dataset })
const jsonldSerialized = await sparqlSerializeQuadStream(dataset.toStream(), 'application/ld+json')

reply.type('text/html').send(await render(request, entityTemplatePath, {
dataset: entityHtml,
entityLabel,
entityUrl,
metadata,
jsonld: jsonldSerialized,
config,
}))
} catch (e) {
Expand Down

0 comments on commit c1295d5

Please sign in to comment.