I did it for a news site that I work on. I didn't do anything fancy, just added the json-ld to the template. That looks something like this:
<script type="application/ld+json">
{
"@type": "NewsArticle",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "{{ self.full_url }}"
},
"headline": "{{ self.title }}",
"image": {% image self.image width-696 as json_img %} {
"@type": "ImageObject",
"url": "{{ json_img.url }}",
"height": {{ json_img.height }},
"width": {{ json_img.width }}
},
"datePublished": "{{ self.date|date:'c' }}",
"dateModified": "{{ self.latest_revision_created_at|date:'c' }}",
"author": {
"@type": "Person",
"name": "{{ self.author }}"
},
"description": "{{ self.description }}"
</script>
Does that help? Or did I miss the point of your question?
-eric