Dynamic Routing: Added migration for routes.yaml file (#9692)

refs #9601

- the home.hbs behaviour for the index collection (`/`) is hardcoded in Ghost
- we would like to migrate all existing routes.yaml files
- we only replace the file if the contents of the routes.yaml file equals the old routes.yaml format (with home.hbs as template)
- updated README of settings folder
- if we don't remove the home.hbs template from the default routes.yaml file, home.hbs will be rendered for any page of the index collection
  - the backwards compatible behaviour was different
  - only render home.hbs for page 1
- remember: the default routes.yaml file reflects how Ghost was working without dynamic routing
This commit is contained in:
Katharina Irrgang 2018-06-22 20:28:01 +02:00 committed by GitHub
parent e9d1d34739
commit 7d9e2a21ad

View File

@ -1,6 +1,20 @@
const crypto = require('crypto');
module.exports.generateHash = function generateHash(options) {
module.exports.generateFromContent = function generateFromContent(options) {
options = options || {};
const hash = crypto.createHash('sha256'),
content = options.content;
let text = '';
hash.update(content);
text += [content, hash.digest('base64')].join('|');
return new Buffer(text).toString('base64');
};
module.exports.generateFromEmail = function generateFromEmail(options) {
options = options || {};
const hash = crypto.createHash('sha256'),