If you exclude the last page in the site.html_pages through exclude_true you end up violating the assumption in the for loop that the last page won't have a trailing comma. This breaks the json data that is served to the front end.
I removed the forloop.last check and instead assign a temporary variable to check for the first non-excluded page, and then add the comma before the next non-excluded entry.
Because `page.title` (and `page.url`) is already escaped and page titles served by lunrjs do not need escaping, ampersands need to be unescaped to display properly in search results.