2f3081fa9f
closes #7769 Because Google AMP is bitching around and shows errors in Googles' webmaster tools for missing post images and blog icons, we decided to make AMP optional. It will be enabled by default, but can be disabled in general settings. Once disabled, the `amp` route doesn't work anymore. This PR contains the back end changes for Ghost-alpha: - Adds `amp` to settings table incl default setting `true` - Adds `amp` value to our settings cache - Changes the route handling of AMP app to check for the `amp` setting first. - Adds tests to check the route handling and ghost_head output - Includes changes to `post-lookup.js` as done by @kirrg001 in #7842
14 lines
385 B
JavaScript
14 lines
385 B
JavaScript
var router = require('./lib/router'),
|
|
registerHelpers = require('./lib/helpers'),
|
|
config = require('../../config');
|
|
|
|
module.exports = {
|
|
activate: function activate(ghost) {
|
|
registerHelpers(ghost);
|
|
},
|
|
|
|
setupRoutes: function setupRoutes(blogRouter) {
|
|
blogRouter.use('*/' + config.get('routeKeywords').amp + '/', router);
|
|
}
|
|
};
|