Have you tried safeJS ?
safeJS
<script type="application/ld+json">{{partial "schema-book.html" . | safeJS }}</script>