-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refs #9192 - an entry is a post or a page, represented by a post model
- Loading branch information
Showing
11 changed files
with
99 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
var debug = require('ghost-ignition').debug('channels:render-post'), | ||
templates = require('./templates'), | ||
formatResponse = require('./format-response'), | ||
setResponseContext = require('./context'); | ||
/* | ||
* Sets the response context around an entry (post or page) | ||
* and renders it with the correct template. | ||
* Used by post preview and entry methods. | ||
* Returns a function that takes the entry to be rendered. | ||
*/ | ||
module.exports = function renderEntry(req, res) { | ||
debug('renderEntry called'); | ||
return function renderEntry(entry) { | ||
// Renderer begin | ||
// Format data 2 - 1 is in preview/entry | ||
var response = formatResponse.entry(entry); | ||
|
||
// Context | ||
setResponseContext(req, res, response); | ||
|
||
// Template | ||
res.template = templates.entry(entry); | ||
|
||
// Render Call | ||
debug('Rendering view: ' + res.template); | ||
res.render(res.template, response); | ||
}; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module.exports = { | ||
preview: require('./preview'), | ||
single: require('./single') | ||
entry: require('./entry') | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.