diff --git a/assets/content/cookbook/Advanced/01.HScript.md b/assets/content/cookbook/Advanced/+01.HScript.md similarity index 100% rename from assets/content/cookbook/Advanced/01.HScript.md rename to assets/content/cookbook/Advanced/+01.HScript.md diff --git a/assets/content/cookbook/Community/01.Community.md b/assets/content/cookbook/Community/+01.Community.md similarity index 100% rename from assets/content/cookbook/Community/01.Community.md rename to assets/content/cookbook/Community/+01.Community.md diff --git a/assets/content/cookbook/Expert/01.ScriptedModules.md b/assets/content/cookbook/Expert/+01.ScriptedModules.md similarity index 100% rename from assets/content/cookbook/Expert/01.ScriptedModules.md rename to assets/content/cookbook/Expert/+01.ScriptedModules.md diff --git a/assets/content/cookbook/Expert/06.MiscellaneousCodingTricks.md b/assets/content/cookbook/Expert/-06.MiscellaneousCodingTricks.md similarity index 100% rename from assets/content/cookbook/Expert/06.MiscellaneousCodingTricks.md rename to assets/content/cookbook/Expert/-06.MiscellaneousCodingTricks.md diff --git a/assets/content/cookbook/Intermediate/01.CustomPlayableCharacters.md b/assets/content/cookbook/Intermediate/+01.CustomPlayableCharacters.md similarity index 100% rename from assets/content/cookbook/Intermediate/01.CustomPlayableCharacters.md rename to assets/content/cookbook/Intermediate/+01.CustomPlayableCharacters.md diff --git a/assets/content/cookbook/Introduction/01.Introduction.md b/assets/content/cookbook/Introduction/+01.Introduction.md similarity index 100% rename from assets/content/cookbook/Introduction/01.Introduction.md rename to assets/content/cookbook/Introduction/+01.Introduction.md diff --git a/src/Generator.hx b/src/Generator.hx index 353ec2ae..747f33d0 100644 --- a/src/Generator.hx +++ b/src/Generator.hx @@ -38,7 +38,7 @@ class Generator { addCookbookPages(cookbookFolder); trace(_pages.length + " articles"); - + var homePage = addGeneralPages(); // create list of categories (after all other pages are added) @@ -77,6 +77,17 @@ class Generator { for (category in sitemap) category.pages.sort(function(a, b) { var a = a.outputPath.file; var b = b.outputPath.file; + + var forcedOrder = [{start: "+", shift: -1}, {start: "-", shift: 1}]; + for (order in forcedOrder) + { + if (a.startsWith(order.start) && !b.startsWith(order.start)) + return order.shift; + + if (!a.startsWith(order.start) && b.startsWith(order.start)) + return -order.shift; + } + return if (a < b) -1; else if (a > b) 1; else 0;