|
43 | 43 |
|
44 | 44 | <li class="divider"></li> |
45 | 45 |
|
46 | | - {% for collection in site.collections %} |
47 | | - <!-- <p>{{ collection.label }}</p> --> |
48 | | - {% if collection.output %} |
49 | | - {% if collection.label == "posts" %} |
50 | | - {% assign reversed_posts = site[collection.label] | reverse %} |
51 | | - {% else %} |
52 | | - {% assign reversed_posts = site[collection.label] %} |
53 | | - {% endif %} |
54 | | - |
55 | | - {% for post in reversed_posts %} |
56 | | - {% if page.url == post.url %} |
57 | | - <li class="chapter active" data-level="1.2" data-path="{{site.baseurl}}{{post.url}}"> |
| 46 | + {% if site.ordered_collections %} |
| 47 | + {% for label in site.ordered_collections %} |
| 48 | + {% assign collection = site.collections | where: "label", label | first %} |
| 49 | + <!-- <p>{{ collection.label }}</p> --> |
| 50 | + {% if collection.output %} |
| 51 | + {% if collection.label == "posts" %} |
| 52 | + {% assign reversed_posts = site[collection.label] | reverse %} |
58 | 53 | {% else %} |
59 | | - <li class="chapter" data-level="1.1" data-path="{{site.baseurl}}{{post.url}}"> |
| 54 | + {% assign reversed_posts = site[collection.label] %} |
60 | 55 | {% endif %} |
61 | | - <a href="{{site.baseurl}}{{post.url}}" onclick="pageScrollToTop(this)"> |
62 | | - {{ post.title | escape }} |
63 | | - </a> |
64 | | - {% if site.toc.enabled %} |
65 | | - {% if page.url == post.url %} |
66 | | - {% include toc.html html=content h_min=site.toc.h_min h_max=site.toc.h_max %} |
| 56 | + |
| 57 | + {% for post in reversed_posts %} |
| 58 | + {% if page.url == post.url %} |
| 59 | + <li class="chapter active" data-level="1.2" data-path="{{site.baseurl}}{{post.url}}"> |
| 60 | + {% else %} |
| 61 | + <li class="chapter" data-level="1.1" data-path="{{site.baseurl}}{{post.url}}"> |
| 62 | + {% endif %} |
| 63 | + <a href="{{site.baseurl}}{{post.url}}" onclick="pageScrollToTop(this)"> |
| 64 | + {{ post.title | escape }} |
| 65 | + </a> |
| 66 | + {% if site.toc.enabled %} |
| 67 | + {% if page.url == post.url %} |
| 68 | + {% include toc.html html=content h_min=site.toc.h_min h_max=site.toc.h_max %} |
| 69 | + {% endif %} |
67 | 70 | {% endif %} |
| 71 | + </li> |
| 72 | + {% endfor %} |
| 73 | + |
| 74 | + {% if reversed_posts.size > 0 %} |
| 75 | + <li class="divider"></li> |
| 76 | + {% endif %} |
| 77 | + {% endif %} |
| 78 | + {% endfor %} |
| 79 | + {% else %} |
| 80 | + {% for collection in site.collections %} |
| 81 | + <!-- <p>{{ collection.label }}</p> --> |
| 82 | + {% if collection.output %} |
| 83 | + {% if collection.label == "posts" %} |
| 84 | + {% assign reversed_posts = site[collection.label] | reverse %} |
| 85 | + {% else %} |
| 86 | + {% assign reversed_posts = site[collection.label] %} |
| 87 | + {% endif %} |
| 88 | + |
| 89 | + {% for post in reversed_posts %} |
| 90 | + {% if page.url == post.url %} |
| 91 | + <li class="chapter active" data-level="1.2" data-path="{{site.baseurl}}{{post.url}}"> |
| 92 | + {% else %} |
| 93 | + <li class="chapter" data-level="1.1" data-path="{{site.baseurl}}{{post.url}}"> |
68 | 94 | {% endif %} |
69 | | - </li> |
70 | | - {% endfor %} |
| 95 | + <a href="{{site.baseurl}}{{post.url}}" onclick="pageScrollToTop(this)"> |
| 96 | + {{ post.title | escape }} |
| 97 | + </a> |
| 98 | + {% if site.toc.enabled %} |
| 99 | + {% if page.url == post.url %} |
| 100 | + {% include toc.html html=content h_min=site.toc.h_min h_max=site.toc.h_max %} |
| 101 | + {% endif %} |
| 102 | + {% endif %} |
| 103 | + </li> |
| 104 | + {% endfor %} |
71 | 105 |
|
72 | | - {% if reversed_posts.size > 0 %} |
73 | | - <li class="divider"></li> |
| 106 | + {% if reversed_posts.size > 0 %} |
| 107 | + <li class="divider"></li> |
| 108 | + {% endif %} |
74 | 109 | {% endif %} |
75 | | - {% endif %} |
76 | | - {% endfor %} |
| 110 | + {% endfor %} |
| 111 | + {% endif %} |
77 | 112 | </ul> |
78 | 113 | </nav> |
79 | 114 | </div> |
0 commit comments