Skip to content

Commit f006712

Browse files
KoloInDaCribKade-github
authored andcommitted
add ability to push a page to front/back
1 parent e99e875 commit f006712

File tree

7 files changed

+12
-1
lines changed

7 files changed

+12
-1
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.

assets/content/cookbook/Expert/06.MiscellaneousCodingTricks.md renamed to assets/content/cookbook/Expert/-06.MiscellaneousCodingTricks.md

File renamed without changes.

assets/content/cookbook/Intermediate/01.CustomPlayableCharacters.md renamed to assets/content/cookbook/Intermediate/+01.CustomPlayableCharacters.md

File renamed without changes.

assets/content/cookbook/Introduction/01.Introduction.md renamed to assets/content/cookbook/Introduction/+01.Introduction.md

File renamed without changes.

src/Generator.hx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Generator {
3838

3939
addCookbookPages(cookbookFolder);
4040
trace(_pages.length + " articles");
41-
41+
4242
var homePage = addGeneralPages();
4343

4444
// create list of categories (after all other pages are added)
@@ -77,6 +77,17 @@ class Generator {
7777
for (category in sitemap) category.pages.sort(function(a, b) {
7878
var a = a.outputPath.file;
7979
var b = b.outputPath.file;
80+
81+
var forcedOrder = [{start: "+", shift: -1}, {start: "-", shift: 1}];
82+
for (order in forcedOrder)
83+
{
84+
if (a.startsWith(order.start) && !b.startsWith(order.start))
85+
return order.shift;
86+
87+
if (!a.startsWith(order.start) && b.startsWith(order.start))
88+
return -order.shift;
89+
}
90+
8091
return if (a < b) -1;
8192
else if (a > b) 1;
8293
else 0;

0 commit comments

Comments
 (0)