tomjoht / documentation-theme-jekyll

A Jekyll-based theme designed for documentation and help systems. See the link for detailed instructions on setting up and configuring everything.
http://idratherbewriting.com/documentation-theme-jekyll/
Other
1.17k stars 1.19k forks source link

Error in the searcher when pages are excluded from the search #222

Closed ivaann2706 closed 2 years ago

ivaann2706 commented 3 years ago

The cause of this error is in the search.json file. The error occurs when the last page (pages are sorted alphabetically) of site.html_pages has the parameter search: "exclude" and no posts exist. This results in an extra comma. This extra comma causes the json to be incorrectly formatted.

This error can be solved by filtering those pages that are excluded from the search (search: "exclude"). This way, the for loop will only iterate over the pages included in the search and there will be no extra commas.

Closes #221