diff --git a/_includes/directory-tree.html b/_includes/directory-tree.html index ad585e3d8..630ab2fd5 100644 --- a/_includes/directory-tree.html +++ b/_includes/directory-tree.html @@ -37,7 +37,6 @@ {%- assign dir_strong = "" -%} {%- assign dir_strong_closing = "" -%} {%- endif -%} - {%- assign prev_page_dir = include.dir -%} {%- assign filtered_pages = "" | split: "," -%} {%- for pg in site.pages -%} {%- comment -%} @@ -54,7 +53,25 @@ {%- endif -%} {%- assign filtered_pages = filtered_pages | push: pg -%} {%- endfor -%} - {%- assign sorted_pages = filtered_pages | sort: "dir" -%} + {%- assign sorted_by_dir = filtered_pages | sort: "dir" -%} + {%- assign subdir_pages = "" | split: "," -%} + {%- assign sorted_pages = "" | split: "," -%} + {%- for pg in sorted_by_dir -%} +prev_page_dir=
{{ prev_page_dir | inspect }}+ {%- if pg.dir == prev_page_dir -%} + {%- assign subdir_pages = subdir_pages | push: pg -%} +subdir_pages=
{{ subdir_pages | inspect }}+ {%- else -%} + {%- assign sorted_subdir_pages = subdir_pages | sort: "dir" -%} + {%- assign sorted_pages = sorted_pages | push: sorted_subdir_pages -%} +sorted_pages=
{{ sorted_pages | inspect }}+ {%- assign subdir_pages = "" | split: "," | push: pg -%} + {%- assign prev_page_dir = pg.dir -%} + {%- endif -%} + {%- endfor -%} + {%- assign sorted_subdir_pages = subdir_pages | sort: "dir" -%} + {%- assign sorted_pages = sorted_pages | push: sorted_subdir_pages -%} + {%- assign prev_page_dir = include.dir -%} {%- for pg in sorted_pages -%} {% unless pg.dir == prev_page_dir -%} {%- assign path = pg.dir | split: "/" -%}