Testing a json content representation of my article template

Your template should look like this:

<?php

$html = '';
$html .= snippet('article', array('article' => $page), true);

echo json_encode($html);

Please remove the controller, it does not make sense.

I’d also change the snippet slightly (note the position of the if-statement):

<div class="article-title">
    <h3><?php echo html($article->title()) ?></h3>
</div>
<div class="article-body">
    <p><?php echo kirbytext($article->text()) ?></p>
</div>
<?php if($image = $article->image()): ?>
  <div class="article-images">
        <img src="<?= $image->url() ?>" alt="<?= $image->alt_text()->html() ?>" />    
  </div>
<?php endif ?>
<div class="article-date">
    <time><?php echo $article->date('d/m/Y') ?></time>
</div>