<ul id="nav">
    {% assign level-1 = site.entries | where: "sectionclass", "h1" | sort: "number"%}
    {% for entry in level-1 %}
    <li {% if entry.is-parent or forloop.first %} class="{% if entry.is-parent %}parent{% endif %}{% if forloop.first %} current{% endif %}"{% endif %}>
        <a href="#{{ entry.sectionid }}">{{ entry.title }}</a>
        {% if entry.is-parent %}
            <ul>
                {% assign level-2 = site.entries | where: "parent-id", entry.sectionid | sort: "number" %}
        