       database.findAllLive({tags:$has:'homepage_demo'}, [date:-1])
 
     getting_started: (database) ->
-      docpadConfig.templateData.getDocCollection(database, 0, '00_getting_started', 'getting_started', 'Getting Started')
+      docpadConfig.templateData.getDocCollection(database, '00_getting_started', 'getting_started', 'Getting Started')
 
     tutorial: (database) ->
-      docpadConfig.templateData.getDocCollection(database, 1, '04_tutorial', 'tutorial', 'Tutorial')
+      docpadConfig.templateData.getDocCollection(database, '01_tutorial', 'tutorial', 'Tutorial')
 
     handbook: (database) ->
-      docpadConfig.templateData.getDocCollection(database, 2, '02_handbook', 'handbook', 'Handbook')
+      docpadConfig.templateData.getDocCollection(database, '02_handbook', 'handbook', 'Handbook')
 
     resources: (database) ->
-      docpadConfig.templateData.getDocCollection(database, 3, '03_resources', 'resources', 'Resources')
+      docpadConfig.templateData.getDocCollection(database, '03_resources', 'resources', 'Resources')
 
     community: (database) ->
-      docpadConfig.templateData.getDocCollection(database, 4, '01_community', 'community', 'Community')
+      docpadConfig.templateData.getDocCollection(database, '04_community', 'community', 'Community')
 
     rootDocuments: (database) ->
       query =

      docsCollection = @getCollection(collection)
      return docsCollection.models[docsCollection.length-1]

    getDocCollection:(database, index, dir, categoryName, categoryTitle) ->
      query =
        write: true
        relativeOutDirPath: $endsWith: dir

        relativeOutDirPath: $startsWith: 'documentation'
        body: $ne: ""
        rootDoc: true
      sorting = [relativeOutDirPath:1]

      database.findAllLive(query, sorting).on 'add', (document) ->
        a = document.attributes
