Ghost/core/server/data/meta/context_object.js
cobbspur 5102637b8e Add structured data to static pages
refs #6534

- adds structured data on static pages
- selects post context object for static pages
- updates tests
2016-03-30 12:57:13 +01:00

14 lines
296 B
JavaScript

var config = require('../../config');
function getContextObject(data, context) {
var blog = config.theme,
contextObject;
context = context === 'page' ? 'post' : context;
contextObject = data[context] || blog;
return contextObject;
}
module.exports = getContextObject;