From c781706998799bc9bc6343edb5dc71a76e69e128 Mon Sep 17 00:00:00 2001 From: Benjamin Lupton Date: Thu, 26 Sep 2013 19:53:06 +1000 Subject: [PATCH] Created custom collections to hopefully avoid the performance issues you were facing --- node/docpad.coffee | 43 ++++++++++++------------------- node/src/documents/index.html.eco | 8 +++--- 2 files changed, 21 insertions(+), 30 deletions(-) diff --git a/node/docpad.coffee b/node/docpad.coffee index 4a8f6ae1b..de1c9873b 100755 --- a/node/docpad.coffee +++ b/node/docpad.coffee @@ -2,32 +2,7 @@ # It is simply a CoffeeScript Object which is parsed by CSON docpadConfig = { - outPath: '../docs', - renderPasses: 1, - - enabledPlugins: - handlebars: false - html2coffee: false - jade: false - marked: false - paged: false - livereload: false - - # Check Version - # Whether or not to check for newer versions of DocPad - checkVersion: true # default - - documentsPaths: [ # default - 'documents' - ] - - # Files Paths - # An array of paths which contents will be treated as files - # If it is a relative path, it will have the resolved `srcPath` prepended to it - filesPaths: [ # default - 'files' - 'public' - ] + outPath: '../docs' # ================================= # Template Data @@ -112,6 +87,22 @@ docpadConfig = { @site.keywords.concat(@document.keywords or []).join(', ') + # ================================= + # Custom Collections + + collections: + uiElements: -> + @getCollection("documents").findAllLive({type: $in: ['UI Element']}, [{title: 1}]) + + uiCollections: -> + @getCollection("documents").findAllLive({type: $in: ['UI Collection']}, [{title: 1}]) + + uiViews: -> + @getCollection("documents").findAllLive({type: $in: ['UI View']}, [{title: 1}]) + + uiModules: -> + @getCollection("documents").findAllLive({type: $in: ['UI Module', 'UI Behavior']}, [{title: 1}]) + # ================================= # DocPad Events diff --git a/node/src/documents/index.html.eco b/node/src/documents/index.html.eco index de890ec9b..de800f098 100755 --- a/node/src/documents/index.html.eco +++ b/node/src/documents/index.html.eco @@ -4,10 +4,10 @@ css : 'index' title : 'Getting Started' type : 'Semantic' --- -<% uiElements = @getCollection("documents").findAllLive({type: $in: ['UI Element']},[{title: 1}]).toJSON() %> -<% uiCollections = @getCollection("documents").findAllLive({type: $in: ['UI Collection']},[{title: 1}]).toJSON() %> -<% uiViews = @getCollection("documents").findAllLive({type: $in: ['UI View']},[{title: 1}]).toJSON() %> -<% uiModules = @getCollection("documents").findAllLive({type: $in: ['UI Module', 'UI Behavior']},[{title: 1}]).toJSON() %> +<% uiElements = @getCollection("uiElements").toJSON() %> +<% uiCollections = @getCollection("uiCollections").toJSON() %> +<% uiViews = @getCollection("uiViews").toJSON() %> +<% uiModules = @getCollection("uiModules").toJSON() %>