backend-manager 5.0.25 → 5.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@ const path = require('path');
|
|
|
8
8
|
const { Octokit } = require('@octokit/rest');
|
|
9
9
|
|
|
10
10
|
const POST_TEMPLATE = jetpack.read(`${__dirname}/templates/post.html`);
|
|
11
|
-
const IMAGE_PATH_SRC = `src/assets/images/blog/
|
|
11
|
+
const IMAGE_PATH_SRC = `src/assets/images/blog/post-{id}/`;
|
|
12
12
|
|
|
13
13
|
const IMAGE_REGEX = /(?:!\[(.*?)\]\((.*?)\))/img;
|
|
14
14
|
|
|
@@ -65,6 +65,8 @@ Module.prototype.main = function () {
|
|
|
65
65
|
.replace(/[^a-zA-Z0-9]/g, '-')
|
|
66
66
|
// Remove multiple hyphens
|
|
67
67
|
.replace(/-+/g, '-')
|
|
68
|
+
// Remove leading and trailing hyphens
|
|
69
|
+
.replace(/^-+|-+$/g, '')
|
|
68
70
|
// Lowercase
|
|
69
71
|
.toLowerCase();
|
|
70
72
|
|
|
@@ -84,7 +86,7 @@ Module.prototype.main = function () {
|
|
|
84
86
|
payload.data.payload.categories = payload.data.payload.categories || [];
|
|
85
87
|
|
|
86
88
|
// Fix even more values
|
|
87
|
-
payload.data.payload.layout = payload.data.payload.layout || '
|
|
89
|
+
payload.data.payload.layout = payload.data.payload.layout || 'blueprint/blog/post';
|
|
88
90
|
payload.data.payload.date = moment(payload.data.payload.date || now).subtract(1, 'days').format('YYYY-MM-DD');
|
|
89
91
|
payload.data.payload.id = payload.data.payload.id || Math.round(new Date(now).getTime() / 1000);
|
|
90
92
|
payload.data.payload.path = `src/_posts/${moment(now).format('YYYY')}/${payload.data.payload.path || 'guest'}`;
|