Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

v2.3.8. Fixed document.contentRaw. Fixed relatedDocuments - new coffe…

…escript version broke it.
  • Loading branch information...
commit 2d2001e621db56dc91a853faed501cc1c862a4f6 1 parent 10b1dfe
@balupton balupton authored
View
2  lib/file.coffee
@@ -136,7 +136,7 @@ class File
@fileMeta or= {}
@content = @fileBody
@contentSrc = @fileBody
- @contentRaw = @fileData
+ @contentRaw = fileData
@contentRendered = @fileBody
@title = @title or @basename or @filename
View
11 lib/plugins/related/related.plugin.coffee
@@ -8,8 +8,9 @@ class RelationsPlugin extends DocpadPlugin
name: 'relations'
# Parsing all files has finished
- parseAfter: ({docpad,logger},next) ->
+ parseAfter: ({logger},next) ->
# Prepare
+ docpad = @docpad
documents = docpad.documents
logger.log 'debug', 'Generating relations'
@@ -20,20 +21,20 @@ class RelationsPlugin extends DocpadPlugin
# Find documents
documents.find {}, (err,docs,length) ->
- return tasks.exit err if err
+ return tasks.exit(err) if err
return tasks.exit() unless length
tasks.total = length
docs.forEach (document) ->
# Find related documents
- documents.find {tags:{'$in':document.tags}}, (err,relatedDocuments) ->
+ documents.find {tags:{'$in':document.tags}}, (err,relatedDocuments,relatedDocumentsLength) ->
return tasks.exit err if err
- return tasks.complete() unless relatedDocuments.length
+ return tasks.complete() unless relatedDocumentsLength
# Fetch
relatedDocumentsArray = []
relatedDocuments.sort (a,b) ->
return a.tags.hasCount(document.tags) < b.tags.hasCount(document.tags)
- .forEach (relatedDocument) ->
+ relatedDocuments.forEach (relatedDocument) ->
return null if document.url is relatedDocument.url
relatedDocumentsArray.push relatedDocument
View
2  package.json
@@ -1,6 +1,6 @@
{
"name": "docpad",
- "version": "2.3.7",
+ "version": "2.3.8",
"description": "DocPad (like Jekyll) is a static website generator, unlike Jekyll it's written in CoffeeScript+Node.js instead of Ruby, and also allows the template engine complete access to the document model. This means you have unlimited power as a CMS and the simplicity of a notepad.",
"homepage": "https://github.com/balupton/docpad",
"keywords": [
Please sign in to comment.
Something went wrong with that request. Please try again.