  <script>
  var jekyll = {};
  (function(model) {
    function parseList(str) { return str.split(',').filter(Boolean) }
    function splitString(html) { return html.split('\n').filter(Boolean) }

    function createSiteTags() {
      var tags = []
      {% for tag in site.tags %}
      tags.push({ name: '{{ tag[0] }}', count: {{ tag[1] | size }} })
      {% endfor %}
      return tags;
    }

    function createSitePosts() {
      var posts = []
      {% for post in site.posts %}
      posts.push({
        title: '{{ post.title }}',
        url: '{{ post.url }}',
        date: new Date('{{ post.date }}'),
        tags: parseList('{{ post.tags | join:"," }}'),
        content: {
          passages: splitString(`{{ post.content | strip_html }}`),
          html: `{{ post.content }}`
        }
      })
      {% endfor %}
      return posts
    }

    model.site = {
      time: new Date('{{ site.time }}'),
      posts: createSitePosts(),
      tags: createSiteTags()
    };
  })(jekyll);
  </script>

  <script>
  var jekyll = {};
  (function(model) {
    function parseList(str) { return str.split(',').filter(Boolean) }
    function splitString(html) { return html.split('\n').filter(Boolean) }

    function createSiteTags() {
      var tags = []
      {% for tag in site.tags %}
      tags.push({ name: '{{ tag[0] }}', count: {{ tag[1] | size }} })
      {% endfor %}
      return tags;
    }

    function createSitePosts() {
      var posts = []
      {% for post in site.posts %}
      posts.push({
        title: '{{ post.title }}',
        url: '{{ post.url }}',
        date: new Date('{{ post.date }}'),
        tags: parseList('{{ post.tags | join:"," }}'),
        content: {
          passages: splitString(unescape('{{ post.content | strip_html | newline_to_br | strip_newlines | split: '<br />' | join: '\n' | escape }}')),
        }
      })
      {% endfor %}
      return posts
    }

    model.site = {
      time: new Date('{{ site.time }}'),
      posts: createSitePosts(),
      tags: createSiteTags()
    };
  })(jekyll);
  </script>

Remove extraneous html content; replace string literals
Remove extraneous html content; replace string literals
