Browse Source

Merge pull request #80 from balupton/patch-customcollections

Created custom collections to hopefully avoid the performance issues you facing
pull/94/head
Jack Lukic 11 years ago
parent
commit
208da62b31
2 changed files with 21 additions and 30 deletions
  1. 43
      node/docpad.coffee
  2. 8
      node/src/documents/index.html.eco

43
node/docpad.coffee

@ -2,32 +2,7 @@
# It is simply a CoffeeScript Object which is parsed by CSON # It is simply a CoffeeScript Object which is parsed by CSON
docpadConfig = { 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 # Template Data
@ -112,6 +87,22 @@ docpadConfig = {
@site.keywords.concat(@document.keywords or []).join(', ') @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 # DocPad Events

8
node/src/documents/index.html.eco

@ -4,10 +4,10 @@ css : 'index'
title : 'Getting Started' title : 'Getting Started'
type : 'Semantic' 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() %>
<script src="/javascript/home.js"></script> <script src="/javascript/home.js"></script>
<div class="masthead segment"> <div class="masthead segment">

Loading…
Cancel
Save