0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00
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

13 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;