Skip to content

Commit

Permalink
v6.17.1. Improvement.
Browse files Browse the repository at this point in the history
- v6.17.1 December 4, 2012
	- Updated misc internals to use the new `File::getOutContent` call
  • Loading branch information
balupton committed Dec 4, 2012
1 parent 938c0fa commit 5c7a829
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
3 changes: 3 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## History

- v6.17.1 December 4, 2012
- Updated misc internals to use the new `File::getOutContent` call

- v6.17.0 December 4, 2012
- Cleaned up the way we handle buffers, data, and meta data - more effecient and simpler api
- Updated
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docpad",
"version": "6.17.0",
"version": "6.17.1",
"description": "DocPad is a language agnostic document management system. This means you write your website as documents, in whatever language you wish, and DocPad will handle the compiling, templates and layouts for you. For static documents it will generate static files, for dynamic documents it'll re-render them on each request. You can utilise DocPad by itself, or use it as a module your own custom system. It's pretty cool, and well worth checking out. We love it.",
"homepage": "https://github.com/bevry/docpad",
"installUrl": "http://docpad.org/install",
Expand Down
11 changes: 5 additions & 6 deletions src/lib/docpad.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -477,11 +477,10 @@ class DocPad extends EventEmitterEnhanced
return docpad.getBlock(name,true)

# Include another file taking in a relative path
# Will return the contentRendered otherwise content
include: (subRelativePath) ->
result = @getFileAtPath(subRelativePath)
if result
return result.get('contentRendered') or result.get('content')
return result.getOutContent()
else
err = new Error(util.format(locale.includeFailed, subRelativePath))
throw err
Expand Down Expand Up @@ -2701,7 +2700,7 @@ class DocPad extends EventEmitterEnhanced
action: 'load contextualize render'
args: [opts]
next: (err) ->
result = document.get('contentRendered')
result = document.getOutContent()
return next(err,result,document)
)
@
Expand Down Expand Up @@ -2750,7 +2749,7 @@ class DocPad extends EventEmitterEnhanced
action: 'normalize contextualize render'
args: [opts]
next: (err) ->
result = document.get('contentRendered')
result = document.getOutContent()
return next(err,result,document)
)
@
Expand Down Expand Up @@ -3063,7 +3062,7 @@ class DocPad extends EventEmitterEnhanced
templateData = balUtil.extend({}, req.templateData or {}, {req,err})
templateData = docpad.getTemplateData(templateData)
document.render {templateData}, (err) ->
content = document.get('contentRendered') or document.get('content') or document.getData()
content = document.getOutContent()
if err
docpad.error(err)
return next(err)
Expand All @@ -3073,7 +3072,7 @@ class DocPad extends EventEmitterEnhanced
else
return res.send(content)
else
content = document.get('contentRendered') or document.get('content') or document.getData()
content = document.getOutContent()
if content
if opts.statusCode?
return res.send(opts.statusCode, content)
Expand Down
3 changes: 1 addition & 2 deletions src/lib/models/file.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,7 @@ class FileModel extends Model

# Get Content
getContent: ->
content = @get('content') or @getBuffer()
return content
return @get('content') or @getBuffer()

# Get Out Content
getOutContent: ->
Expand Down

0 comments on commit 5c7a829

Please sign in to comment.