tags.
{% endcomment %}
{% assign markdown = "" %}
{% assign indices = site.documents | where: "collection", site.theme-settings.collection | where_exp: "page", "page.chapnum != null" | where_exp: "page", "page.pagenum == null" | sort: "chapnum" %}
{% if page.subsite %}
{% assign indices = indices | where: "subsite", page.subsite %}
{% endif %}
{% for index in indices %}
{% assign pages = site.documents | where: "collection", site.theme-settings.collection | where: "chapnum", index.chapnum | where_exp: "page", "page.pagenum != null" | sort: "pagenum" %}
{% if page.subsite %}
{% assign pages = pages | where: "subsite", page.subsite %}
{% endif %}
{% capture content %}
# Chapter {{ index.chapnum }}: {{ index.chapter | escape }}
{% assign description = index.content | strip %}{% if description.size > 0 %}{{ description }}{% endif %}
{% for page in pages %}
# {{ page.title | escape }}
{{ page.content }}
{% endfor %}
{% endcapture %}
{% assign markdown = markdown | append: content %}
{% endfor %}
{% comment %}
Render our generated markdown string and strip away the comment wrappers from our HTML tags.
{% endcomment %}
{% assign rendered = markdown | markdownify | replace: "", "" %}
{% comment %}
Output our book cover.
{% endcomment %}
{{ site.title | escape }}
Contents
{% capture toc %}{% include thirdparty/toc.html html=rendered sanitize=true %}{% endcapture %}
{{ toc | replace: '