ghost 4.41.3 → 4.43.0
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/content/themes/casper/package.json +2 -3
- package/content/themes/casper/partials/post-card.hbs +1 -1
- package/core/built/assets/ghost-dark-1933079797e24ccb8839657020830be5.css +1 -0
- package/core/built/assets/{ghost.min-1abf114ca26a71e8e1f09054f3592614.js → ghost.min-2a278873d60d6a13a4c05a396e5bed5e.js} +533 -398
- package/core/built/assets/ghost.min-38f3c38c0c6a1864f57079b068a0b0ce.css +1 -0
- package/core/built/assets/{vendor.min-9094db77ba3190cb10876f8e42e1d90d.js → vendor.min-21f79c68a284acb1b70039f3f63e5507.js} +68 -68
- package/core/built/assets/{vendor.min-2c8ad32b7960bb605ebc20097fee5ebd.css → vendor.min-ba66b98f7c24fa40e061c7ffc94f4e23.css} +214 -0
- package/core/frontend/apps/amp/lib/helpers/amp_analytics.js +1 -1
- package/core/frontend/apps/amp/lib/helpers/amp_components.js +1 -1
- package/core/frontend/apps/amp/lib/helpers/amp_content.js +1 -1
- package/core/frontend/apps/amp/lib/helpers/amp_style.js +1 -1
- package/core/frontend/apps/amp/lib/router.js +6 -5
- package/core/frontend/apps/private-blogging/lib/helpers/input_password.js +1 -1
- package/core/frontend/apps/private-blogging/lib/router.js +2 -2
- package/core/frontend/helpers/asset.js +1 -1
- package/core/frontend/helpers/author.js +1 -1
- package/core/frontend/helpers/authors.js +1 -1
- package/core/frontend/helpers/body_class.js +1 -1
- package/core/frontend/helpers/cancel_link.js +1 -1
- package/core/frontend/helpers/concat.js +1 -1
- package/core/frontend/helpers/content.js +1 -1
- package/core/frontend/helpers/date.js +1 -1
- package/core/frontend/helpers/encode.js +1 -1
- package/core/frontend/helpers/excerpt.js +1 -1
- package/core/frontend/helpers/facebook_url.js +1 -1
- package/core/frontend/helpers/foreach.js +2 -2
- package/core/frontend/helpers/get.js +1 -1
- package/core/frontend/helpers/ghost_foot.js +1 -1
- package/core/frontend/helpers/ghost_head.js +1 -1
- package/core/frontend/helpers/lang.js +1 -1
- package/core/frontend/helpers/link.js +1 -1
- package/core/frontend/helpers/link_class.js +1 -1
- package/core/frontend/helpers/match.js +1 -1
- package/core/frontend/helpers/navigation.js +1 -1
- package/core/frontend/helpers/pagination.js +1 -1
- package/core/frontend/helpers/plural.js +1 -1
- package/core/frontend/helpers/post_class.js +1 -1
- package/core/frontend/helpers/prev_post.js +6 -5
- package/core/frontend/helpers/price.js +1 -0
- package/core/frontend/helpers/products.js +1 -1
- package/core/frontend/helpers/reading_time.js +2 -2
- package/core/frontend/helpers/t.js +1 -1
- package/core/frontend/helpers/tags.js +1 -1
- package/core/frontend/helpers/tiers.js +1 -1
- package/core/frontend/helpers/title.js +1 -1
- package/core/frontend/helpers/twitter_url.js +1 -1
- package/core/frontend/helpers/url.js +1 -1
- package/core/frontend/meta/url.js +4 -4
- package/core/{server/data/schema → frontend/services/data}/checks.js +4 -4
- package/core/frontend/services/{routing/helpers → data}/entry-lookup.js +3 -3
- package/core/frontend/services/{routing/helpers → data}/fetch-data.js +3 -3
- package/core/frontend/services/data/index.js +5 -0
- package/core/frontend/services/{rendering.js → handlebars.js} +2 -1
- package/core/frontend/services/helpers/handlebars.js +1 -1
- package/core/frontend/services/proxy.js +2 -4
- package/core/frontend/services/{routing/helpers → rendering}/context.js +0 -0
- package/core/frontend/services/{routing/helpers → rendering}/error.js +0 -0
- package/core/frontend/services/{routing/helpers → rendering}/format-response.js +1 -1
- package/core/frontend/services/{routing/helpers → rendering}/index.js +0 -8
- package/core/frontend/services/{routing/helpers → rendering}/render-entries.js +1 -1
- package/core/frontend/services/{routing/helpers → rendering}/render-entry.js +1 -1
- package/core/frontend/services/{routing/helpers → rendering}/renderer.js +1 -1
- package/core/frontend/services/{routing/helpers → rendering}/secure.js +0 -0
- package/core/frontend/services/{routing/helpers → rendering}/templates.js +2 -2
- package/core/frontend/services/routing/CollectionRouter.js +1 -1
- package/core/frontend/services/routing/controllers/channel.js +9 -9
- package/core/frontend/services/routing/controllers/collection.js +9 -9
- package/core/frontend/services/routing/controllers/email-post.js +5 -6
- package/core/frontend/services/routing/controllers/entry.js +6 -6
- package/core/frontend/services/routing/controllers/preview.js +5 -6
- package/core/frontend/services/routing/controllers/rss.js +4 -3
- package/core/frontend/services/routing/controllers/static.js +5 -5
- package/core/frontend/services/routing/controllers/unsubscribe.js +2 -2
- package/core/frontend/services/routing/index.js +0 -4
- package/core/frontend/web/middleware/error-handler.js +2 -2
- package/core/server/api/canary/email-preview.js +2 -1
- package/core/server/api/canary/{email.js → emails.js} +0 -0
- package/core/server/api/canary/index.js +9 -1
- package/core/server/api/canary/members.js +0 -45
- package/core/server/api/canary/newsletters.js +45 -0
- package/core/server/api/canary/stats.js +23 -0
- package/core/server/api/canary/utils/serializers/output/email-previews.js +7 -0
- package/core/server/api/canary/utils/serializers/output/index.js +2 -22
- package/core/server/api/canary/utils/serializers/output/mappers/index.js +1 -0
- package/core/server/api/canary/utils/serializers/output/mappers/snippets.js +36 -0
- package/core/server/api/canary/utils/serializers/output/members.js +5 -2
- package/core/server/api/canary/utils/serializers/output/oembed.js +2 -2
- package/core/server/api/canary/utils/serializers/output/redirects.js +2 -2
- package/core/server/api/canary/utils/serializers/output/schedules.js +2 -2
- package/core/server/api/canary/utils/serializers/output/slack.js +2 -2
- package/core/server/api/canary/utils/serializers/output/themes.js +2 -2
- package/core/server/api/canary/utils/serializers/output/users.js +0 -23
- package/core/server/api/canary/utils/validators/input/index.js +6 -0
- package/core/server/api/shared/http.js +52 -51
- package/core/server/api/shared/serializers/handle.js +25 -26
- package/core/server/data/exporter/table-lists.js +2 -0
- package/core/server/data/migrations/utils.js +34 -2
- package/core/server/data/migrations/versions/4.42/2022-03-21-17-17-add.js +25 -0
- package/core/server/data/migrations/versions/4.42/2022-03-30-15-44-add-newsletter-permissions.js +28 -0
- package/core/server/data/migrations/versions/4.43/2022-03-28-19-26-recreate-newsletter-table.js +29 -0
- package/core/server/data/migrations/versions/4.43/2022-03-29-14-45-add-members-newsletters-table.js +7 -0
- package/core/server/data/migrations/versions/4.43/2022-04-01-10-13-add-post-newsletter-relation.js +108 -0
- package/core/server/data/migrations/versions/4.43/2022-04-06-09-47-add-type-column-to-paid-subscription-events.js +7 -0
- package/core/server/data/migrations/versions/4.43/2022-04-06-14-56-add-email-newsletter-relation.js +8 -0
- package/core/server/data/migrations/versions/4.43/2022-04-08-10-45-add-subscription-id-to-mrr-events.js +7 -0
- package/core/server/data/schema/commands.js +19 -14
- package/core/server/data/schema/index.js +0 -1
- package/core/server/data/schema/schema.js +36 -0
- package/core/server/models/base/bookshelf.js +1 -1
- package/core/server/models/base/plugins/crud.js +8 -0
- package/core/server/models/member.js +18 -1
- package/core/server/models/newsletter.js +43 -0
- package/core/server/models/post.js +4 -1
- package/core/server/services/auth/setup.js +4 -1
- package/core/server/services/mega/template.js +25 -13
- package/core/server/services/members/api.js +3 -1
- package/core/server/services/members/middleware.js +13 -3
- package/core/server/services/members/service.js +2 -1
- package/core/server/services/members/utils.js +13 -1
- package/core/server/services/newsletters/index.js +10 -0
- package/core/server/services/newsletters/service.js +24 -0
- package/core/server/services/slack.js +11 -3
- package/core/server/services/stats/index.js +1 -0
- package/core/server/services/stats/lib/members-stats-service.js +161 -0
- package/core/server/services/stats/lib/mrr-stats-service.js +154 -0
- package/core/server/services/stats/service.js +8 -0
- package/core/server/services/stripe/service.js +1 -0
- package/core/server/services/webhooks/webhooks-service.js +3 -1
- package/core/server/web/admin/views/default-prod.html +5 -5
- package/core/server/web/admin/views/default.html +5 -5
- package/core/server/web/api/canary/admin/routes.js +9 -2
- package/core/shared/config/defaults.json +2 -2
- package/core/shared/config/env/config.development.json +26 -0
- package/core/shared/config/env/config.production.json +21 -0
- package/core/shared/config/env/config.testing-mysql.json +59 -0
- package/core/shared/config/env/config.testing.json +58 -0
- package/package.json +50 -50
- package/yarn.lock +700 -769
- package/content/themes/casper/assets/css/csscomb.json +0 -240
- package/core/built/assets/ghost-dark-146c4c688b47d45c4aa018ee0f79cebc.css +0 -1
- package/core/built/assets/ghost.min-a73b150c7eecc4641d377cc73fb5eecd.css +0 -1
- package/core/server/api/canary/utils/serializers/output/email-preview.js +0 -10
- package/core/server/api/canary/utils/serializers/output/emails.js +0 -22
- package/core/server/api/canary/utils/serializers/output/identities.js +0 -7
- package/core/server/api/canary/utils/serializers/output/member-signin-urls.js +0 -7
- package/core/server/api/canary/utils/serializers/output/snippets.js +0 -107
- package/core/server/api/canary/utils/serializers/output/webhooks.js +0 -15
|
@@ -1202,6 +1202,220 @@ ol .occluded-content {
|
|
|
1202
1202
|
height: 0;
|
|
1203
1203
|
}
|
|
1204
1204
|
|
|
1205
|
+
:root {
|
|
1206
|
+
/* The named -duration and -delay variables will be lowered to near zero when using the setupPromiseModals test helper */
|
|
1207
|
+
--epm-animation-backdrop-in-duration: 0.3s;
|
|
1208
|
+
--epm-animation-backdrop-out-duration: 0.18s;
|
|
1209
|
+
--epm-animation-modal-in-duration: 0.3s;
|
|
1210
|
+
--epm-animation-modal-out-duration: 0.18s;
|
|
1211
|
+
--epm-animation-backdrop-in-delay: 0s;
|
|
1212
|
+
--epm-animation-backdrop-out-delay: 0s;
|
|
1213
|
+
--epm-animation-modal-in-delay: 0s;
|
|
1214
|
+
--epm-animation-modal-out-delay: 0s;
|
|
1215
|
+
--epm-animation-backdrop-in: var(--epm-animation-backdrop-in-duration) ease var(--epm-animation-backdrop-in-delay) forwards epm-backdrop-in;
|
|
1216
|
+
--epm-animation-backdrop-out: var(--epm-animation-backdrop-out-duration) ease var(--epm-animation-backdrop-out-delay) forwards epm-backdrop-out;
|
|
1217
|
+
--epm-animation-modal-in: var(--epm-animation-modal-in-duration) ease-out var(--epm-animation-modal-in-delay) forwards epm-modal-in;
|
|
1218
|
+
--epm-animation-modal-out: var(--epm-animation-modal-out-duration) ease-out var(--epm-animation-modal-out-delay) forwards epm-modal-out;
|
|
1219
|
+
--epm-backdrop-background: #2d3748CD;
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1223
|
+
:root {
|
|
1224
|
+
--epm-animation-backdrop-in-duration: 0s;
|
|
1225
|
+
--epm-animation-backdrop-out-duration: 0s;
|
|
1226
|
+
--epm-animation-modal-in-duration: 0s;
|
|
1227
|
+
--epm-animation-modal-out-duration: 0s;
|
|
1228
|
+
--epm-animation-backdrop-in-delay: 0s;
|
|
1229
|
+
--epm-animation-backdrop-out-delay: 0s;
|
|
1230
|
+
--epm-animation-modal-in-delay: 0s;
|
|
1231
|
+
--epm-animation-modal-out-delay: 0s;
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
.epm-scrolling-disabled {
|
|
1236
|
+
overflow: hidden;
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
.epm-backdrop,
|
|
1240
|
+
.epm-modal-container {
|
|
1241
|
+
position: fixed;
|
|
1242
|
+
top: 0;
|
|
1243
|
+
right: 0;
|
|
1244
|
+
bottom: 0;
|
|
1245
|
+
left: 0;
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
.epm-backdrop {
|
|
1249
|
+
background-color: #2d3748CD;
|
|
1250
|
+
background-color: var(--epm-backdrop-background);
|
|
1251
|
+
opacity: 0;
|
|
1252
|
+
-webkit-animation: 0.3s ease 0s forwards epm-backdrop-in;
|
|
1253
|
+
animation: 0.3s ease 0s forwards epm-backdrop-in;
|
|
1254
|
+
-webkit-animation: var(--epm-animation-backdrop-in);
|
|
1255
|
+
animation: var(--epm-animation-backdrop-in);
|
|
1256
|
+
-webkit-animation-delay: 0s;
|
|
1257
|
+
animation-delay: 0s;
|
|
1258
|
+
-webkit-animation-delay: var(--epm-animation-backdrop-in-delay);
|
|
1259
|
+
animation-delay: var(--epm-animation-backdrop-in-delay);
|
|
1260
|
+
-webkit-animation-duration: 0.3s;
|
|
1261
|
+
animation-duration: 0.3s;
|
|
1262
|
+
-webkit-animation-duration: var(--epm-animation-backdrop-in-duration);
|
|
1263
|
+
animation-duration: var(--epm-animation-backdrop-in-duration);
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
.epm-modal-container {
|
|
1267
|
+
display: flex;
|
|
1268
|
+
align-items: center;
|
|
1269
|
+
justify-content: center;
|
|
1270
|
+
overflow: auto;
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
.epm-animating .epm-modal-container {
|
|
1274
|
+
overflow: unset;
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
.epm-modal {
|
|
1278
|
+
margin: auto;
|
|
1279
|
+
transform: translate(0, -30vh) scale(1.1);
|
|
1280
|
+
opacity: 0;
|
|
1281
|
+
-webkit-animation: 0.3s ease-out 0s forwards epm-modal-in;
|
|
1282
|
+
animation: 0.3s ease-out 0s forwards epm-modal-in;
|
|
1283
|
+
-webkit-animation: var(--epm-animation-modal-in);
|
|
1284
|
+
animation: var(--epm-animation-modal-in);
|
|
1285
|
+
-webkit-animation-delay: 0s;
|
|
1286
|
+
animation-delay: 0s;
|
|
1287
|
+
-webkit-animation-delay: var(--epm-animation-modal-in-delay);
|
|
1288
|
+
animation-delay: var(--epm-animation-modal-in-delay);
|
|
1289
|
+
-webkit-animation-duration: 0.3s;
|
|
1290
|
+
animation-duration: 0.3s;
|
|
1291
|
+
-webkit-animation-duration: var(--epm-animation-modal-in-duration);
|
|
1292
|
+
animation-duration: var(--epm-animation-modal-in-duration);
|
|
1293
|
+
-webkit-overflow-scrolling: touch; /* momentum-based scrolling for Safari on iOS */
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
.epm-backdrop.epm-out {
|
|
1297
|
+
opacity: 1;
|
|
1298
|
+
-webkit-animation: 0.18s ease 0s forwards epm-backdrop-out;
|
|
1299
|
+
animation: 0.18s ease 0s forwards epm-backdrop-out;
|
|
1300
|
+
-webkit-animation: var(--epm-animation-backdrop-out);
|
|
1301
|
+
animation: var(--epm-animation-backdrop-out);
|
|
1302
|
+
-webkit-animation-delay: 0s;
|
|
1303
|
+
animation-delay: 0s;
|
|
1304
|
+
-webkit-animation-delay: var(--epm-animation-backdrop-out-delay);
|
|
1305
|
+
animation-delay: var(--epm-animation-backdrop-out-delay);
|
|
1306
|
+
-webkit-animation-duration: 0.18s;
|
|
1307
|
+
animation-duration: 0.18s;
|
|
1308
|
+
-webkit-animation-duration: var(--epm-animation-backdrop-out-duration);
|
|
1309
|
+
animation-duration: var(--epm-animation-backdrop-out-duration);
|
|
1310
|
+
pointer-events: none;
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
.epm-modal.epm-out {
|
|
1314
|
+
transform: translate(0, 0) scale(1);
|
|
1315
|
+
opacity: 1;
|
|
1316
|
+
-webkit-animation: 0.18s ease-out 0s forwards epm-modal-out;
|
|
1317
|
+
animation: 0.18s ease-out 0s forwards epm-modal-out;
|
|
1318
|
+
-webkit-animation: var(--epm-animation-modal-out);
|
|
1319
|
+
animation: var(--epm-animation-modal-out);
|
|
1320
|
+
-webkit-animation-delay: 0s;
|
|
1321
|
+
animation-delay: 0s;
|
|
1322
|
+
-webkit-animation-delay: var(--epm-animation-modal-out-delay);
|
|
1323
|
+
animation-delay: var(--epm-animation-modal-out-delay);
|
|
1324
|
+
-webkit-animation-duration: 0.18s;
|
|
1325
|
+
animation-duration: 0.18s;
|
|
1326
|
+
-webkit-animation-duration: var(--epm-animation-modal-out-duration);
|
|
1327
|
+
animation-duration: var(--epm-animation-modal-out-duration);
|
|
1328
|
+
pointer-events: none;
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
@-webkit-keyframes epm-backdrop-in {
|
|
1332
|
+
0% {
|
|
1333
|
+
opacity: 0;
|
|
1334
|
+
}
|
|
1335
|
+
100% {
|
|
1336
|
+
opacity: 1;
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
@keyframes epm-backdrop-in {
|
|
1341
|
+
0% {
|
|
1342
|
+
opacity: 0;
|
|
1343
|
+
}
|
|
1344
|
+
100% {
|
|
1345
|
+
opacity: 1;
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
@-webkit-keyframes epm-backdrop-out {
|
|
1350
|
+
0% {
|
|
1351
|
+
opacity: 1;
|
|
1352
|
+
}
|
|
1353
|
+
100% {
|
|
1354
|
+
opacity: 0;
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
@keyframes epm-backdrop-out {
|
|
1359
|
+
0% {
|
|
1360
|
+
opacity: 1;
|
|
1361
|
+
}
|
|
1362
|
+
100% {
|
|
1363
|
+
opacity: 0;
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
@-webkit-keyframes epm-modal-in {
|
|
1368
|
+
0% {
|
|
1369
|
+
transform: translate(0, -30vh) scale(1.1);
|
|
1370
|
+
opacity: 0;
|
|
1371
|
+
}
|
|
1372
|
+
72% {
|
|
1373
|
+
transform: translate(0, 0) scale(0.99);
|
|
1374
|
+
opacity: 1;
|
|
1375
|
+
}
|
|
1376
|
+
100% {
|
|
1377
|
+
transform: translate(0, 0) scale(1);
|
|
1378
|
+
opacity: 1;
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
@keyframes epm-modal-in {
|
|
1383
|
+
0% {
|
|
1384
|
+
transform: translate(0, -30vh) scale(1.1);
|
|
1385
|
+
opacity: 0;
|
|
1386
|
+
}
|
|
1387
|
+
72% {
|
|
1388
|
+
transform: translate(0, 0) scale(0.99);
|
|
1389
|
+
opacity: 1;
|
|
1390
|
+
}
|
|
1391
|
+
100% {
|
|
1392
|
+
transform: translate(0, 0) scale(1);
|
|
1393
|
+
opacity: 1;
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
@-webkit-keyframes epm-modal-out {
|
|
1398
|
+
0% {
|
|
1399
|
+
transform: translate(0, 0) scale(1);
|
|
1400
|
+
opacity: 1;
|
|
1401
|
+
}
|
|
1402
|
+
100% {
|
|
1403
|
+
transform: translate(0, -10vh) scale(0.8);
|
|
1404
|
+
opacity: 0;
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
@keyframes epm-modal-out {
|
|
1409
|
+
0% {
|
|
1410
|
+
transform: translate(0, 0) scale(1);
|
|
1411
|
+
opacity: 1;
|
|
1412
|
+
}
|
|
1413
|
+
100% {
|
|
1414
|
+
transform: translate(0, -10vh) scale(0.8);
|
|
1415
|
+
opacity: 0;
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
|
|
1205
1419
|
.ember-tooltip-base {
|
|
1206
1420
|
display: none;
|
|
1207
1421
|
height: 0;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
// Outputs inline scripts used for analytics
|
|
5
5
|
const {settingsCache} = require('../../../../services/proxy');
|
|
6
|
-
const {SafeString} = require('../../../../services/
|
|
6
|
+
const {SafeString} = require('../../../../services/handlebars');
|
|
7
7
|
|
|
8
8
|
function ampComponents() {
|
|
9
9
|
let components = [];
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// amp-img, amp-ad, amp-embed, amp-video and amp-pixel.
|
|
10
10
|
// (less) dirty requires
|
|
11
11
|
const {settingsCache} = require('../../../../services/proxy');
|
|
12
|
-
const {SafeString} = require('../../../../services/
|
|
12
|
+
const {SafeString} = require('../../../../services/handlebars');
|
|
13
13
|
|
|
14
14
|
function ampComponents() {
|
|
15
15
|
let components = [];
|
|
@@ -12,7 +12,7 @@ const {DateTime, Interval} = require('luxon');
|
|
|
12
12
|
const errors = require('@tryghost/errors');
|
|
13
13
|
const logging = require('@tryghost/logging');
|
|
14
14
|
|
|
15
|
-
const {SafeString} = require('../../../../services/
|
|
15
|
+
const {SafeString} = require('../../../../services/handlebars');
|
|
16
16
|
|
|
17
17
|
const amperizeCache = {};
|
|
18
18
|
let allowedAMPTags = [];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const {SafeString, escapeExpression} = require('../../../../services/
|
|
1
|
+
const {SafeString, escapeExpression} = require('../../../../services/handlebars');
|
|
2
2
|
|
|
3
3
|
module.exports = function amp_style(options) { // eslint-disable-line camelcase
|
|
4
4
|
if (options.data.site.accent_color) {
|
|
@@ -7,7 +7,8 @@ const errors = require('@tryghost/errors');
|
|
|
7
7
|
|
|
8
8
|
// Dirty requires
|
|
9
9
|
const urlService = require('../../../../server/services/url');
|
|
10
|
-
const
|
|
10
|
+
const dataService = require('../../../services/data');
|
|
11
|
+
const renderer = require('../../../services/rendering');
|
|
11
12
|
const templateName = 'amp';
|
|
12
13
|
|
|
13
14
|
const messages = {
|
|
@@ -23,15 +24,15 @@ function _renderer(req, res, next) {
|
|
|
23
24
|
|
|
24
25
|
// Renderer begin
|
|
25
26
|
// Format data
|
|
26
|
-
let
|
|
27
|
+
let body = req.body || {};
|
|
27
28
|
|
|
28
29
|
// CASE: we only support amp pages for posts that are not static pages
|
|
29
|
-
if (!
|
|
30
|
+
if (!body.post || body.post.page) {
|
|
30
31
|
return next(new errors.NotFoundError({message: tpl(messages.pageNotFound)}));
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
// Render Call
|
|
34
|
-
return
|
|
35
|
+
return renderer.renderer(req, res, body);
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
// This here is a controller.
|
|
@@ -71,7 +72,7 @@ function getPostData(req, res, next) {
|
|
|
71
72
|
|
|
72
73
|
// @NOTE: amp is not supported for static pages
|
|
73
74
|
// @TODO: https://github.com/TryGhost/Ghost/issues/10548
|
|
74
|
-
|
|
75
|
+
dataService.entryLookup(urlWithoutSubdirectoryWithoutAmp, {permalinks, query: {controller: 'postsPublic', resource: 'posts'}}, res.locals)
|
|
75
76
|
.then((result) => {
|
|
76
77
|
if (result && result.entry) {
|
|
77
78
|
req.body.post = result.entry;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// Password input used on private.hbs for password-protected blogs
|
|
5
5
|
|
|
6
6
|
// (less) dirty requires
|
|
7
|
-
const {SafeString, templates} = require('../../../../services/
|
|
7
|
+
const {SafeString, templates} = require('../../../../services/handlebars');
|
|
8
8
|
|
|
9
9
|
// We use the name input_password to match the helper for consistency:
|
|
10
10
|
module.exports = function input_password(options) { // eslint-disable-line camelcase
|
|
@@ -2,7 +2,7 @@ const path = require('path');
|
|
|
2
2
|
const express = require('../../../../shared/express');
|
|
3
3
|
const middleware = require('./middleware');
|
|
4
4
|
const bodyParser = require('body-parser');
|
|
5
|
-
const
|
|
5
|
+
const renderer = require('../../../services/rendering');
|
|
6
6
|
const web = require('../../../../server/web');
|
|
7
7
|
const templateName = 'private';
|
|
8
8
|
const privateRouter = express.Router(templateName);
|
|
@@ -23,7 +23,7 @@ function _renderer(req, res) {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
// Render Call
|
|
26
|
-
return
|
|
26
|
+
return renderer.renderer(req, res, data);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
// password-protected frontend route
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
// Returns the path to the specified asset.
|
|
5
5
|
const {metaData, urlUtils} = require('../services/proxy');
|
|
6
|
-
const {SafeString} = require('../services/
|
|
6
|
+
const {SafeString} = require('../services/handlebars');
|
|
7
7
|
|
|
8
8
|
const errors = require('@tryghost/errors');
|
|
9
9
|
const tpl = require('@tryghost/tpl');
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// Block helper: `{{#author}}{{/author}}`
|
|
11
11
|
// This is the default handlebars behaviour of dropping into the author object scope
|
|
12
12
|
const {urlService} = require('../services/proxy');
|
|
13
|
-
const {SafeString, escapeExpression, hbs, templates} = require('../services/
|
|
13
|
+
const {SafeString, escapeExpression, hbs, templates} = require('../services/handlebars');
|
|
14
14
|
const isString = require('lodash/isString');
|
|
15
15
|
|
|
16
16
|
const builtInHelpers = hbs.handlebars.helpers;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
//
|
|
8
8
|
// Note that the standard {{#each authors}} implementation is unaffected by this helper.
|
|
9
9
|
const {urlService} = require('../services/proxy');
|
|
10
|
-
const {SafeString, escapeExpression, templates} = require('../services/
|
|
10
|
+
const {SafeString, escapeExpression, templates} = require('../services/handlebars');
|
|
11
11
|
const isString = require('lodash/isString');
|
|
12
12
|
const {utils} = require('@tryghost/helpers');
|
|
13
13
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Usage: `{{body_class}}`
|
|
3
3
|
//
|
|
4
4
|
// Output classes for the body element
|
|
5
|
-
const {SafeString} = require('../services/
|
|
5
|
+
const {SafeString} = require('../services/handlebars');
|
|
6
6
|
|
|
7
7
|
// We use the name body_class to match the helper for consistency
|
|
8
8
|
module.exports = function body_class(options) { // eslint-disable-line camelcase
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
//
|
|
7
7
|
// Defaults to class="cancel-subscription-link" errorClass="cancel-subscription-error" cancelLabel="Cancel subscription" continueLabel="Continue subscription"
|
|
8
8
|
const {labs} = require('../services/proxy');
|
|
9
|
-
const {templates} = require('../services/
|
|
9
|
+
const {templates} = require('../services/handlebars');
|
|
10
10
|
|
|
11
11
|
const errors = require('@tryghost/errors');
|
|
12
12
|
const tpl = require('@tryghost/tpl');
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
//
|
|
11
11
|
// Dev flag feature: In case of restricted content access for member-only posts, shows CTA box
|
|
12
12
|
|
|
13
|
-
const {templates, hbs, SafeString} = require('../services/
|
|
13
|
+
const {templates, hbs, SafeString} = require('../services/handlebars');
|
|
14
14
|
const downsize = require('downsize');
|
|
15
15
|
const _ = require('lodash');
|
|
16
16
|
const createFrame = hbs.handlebars.createFrame;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
// Formats a date using moment-timezone.js. Formats published_at by default but will also take a date as a parameter
|
|
5
5
|
|
|
6
|
-
const {SafeString} = require('../services/
|
|
6
|
+
const {SafeString} = require('../services/handlebars');
|
|
7
7
|
const moment = require('moment-timezone');
|
|
8
8
|
const _ = require('lodash');
|
|
9
9
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
//
|
|
6
6
|
// Defaults to words="50"
|
|
7
7
|
|
|
8
|
-
const {SafeString} = require('../services/
|
|
8
|
+
const {SafeString} = require('../services/handlebars');
|
|
9
9
|
const {metaData} = require('../services/proxy');
|
|
10
10
|
const _ = require('lodash');
|
|
11
11
|
const getMetaDataExcerpt = metaData.getMetaDataExcerpt;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
// Output a url for a facebook username
|
|
5
5
|
const {socialUrls} = require('../services/proxy');
|
|
6
|
-
const {localUtils} = require('../services/
|
|
6
|
+
const {localUtils} = require('../services/handlebars');
|
|
7
7
|
|
|
8
8
|
// We use the name facebook_url to match the helper for consistency:
|
|
9
9
|
module.exports = function facebook_url(username, options) { // eslint-disable-line camelcase
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// Usage: `{{#foreach data}}{{/foreach}}`
|
|
3
3
|
//
|
|
4
4
|
// Block helper designed for looping through posts
|
|
5
|
-
const {checks} = require('../services/
|
|
6
|
-
const {hbs} = require('../services/
|
|
5
|
+
const {checks} = require('../services/data');
|
|
6
|
+
const {hbs} = require('../services/handlebars');
|
|
7
7
|
|
|
8
8
|
const _ = require('lodash');
|
|
9
9
|
const logging = require('@tryghost/logging');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Usage: `{{#get "posts" limit="5"}}`, `{{#get "tags" limit="all"}}`
|
|
3
3
|
// Fetches data from the API
|
|
4
4
|
const {config, api, prepareContextResource} = require('../services/proxy');
|
|
5
|
-
const {hbs} = require('../services/
|
|
5
|
+
const {hbs} = require('../services/handlebars');
|
|
6
6
|
|
|
7
7
|
const logging = require('@tryghost/logging');
|
|
8
8
|
const errors = require('@tryghost/errors');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
// Outputs scripts and other assets at the bottom of a Ghost theme
|
|
5
5
|
const {settingsCache} = require('../services/proxy');
|
|
6
|
-
const {SafeString} = require('../services/
|
|
6
|
+
const {SafeString} = require('../services/handlebars');
|
|
7
7
|
const _ = require('lodash');
|
|
8
8
|
|
|
9
9
|
// We use the name ghost_foot to match the helper for consistency:
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
// Outputs scripts and other assets at the top of a Ghost theme
|
|
5
5
|
const {metaData, settingsCache, config, blogIcon, urlUtils, labs} = require('../services/proxy');
|
|
6
|
-
const {escapeExpression, SafeString} = require('../services/
|
|
6
|
+
const {escapeExpression, SafeString} = require('../services/handlebars');
|
|
7
7
|
|
|
8
8
|
// BAD REQUIRE
|
|
9
9
|
// @TODO fix this require
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// Language tags in HTML and XML
|
|
13
13
|
// https://www.w3.org/International/articles/language-tags/
|
|
14
14
|
|
|
15
|
-
const {SafeString} = require('../services/
|
|
15
|
+
const {SafeString} = require('../services/handlebars');
|
|
16
16
|
|
|
17
17
|
module.exports = function lang(options) {
|
|
18
18
|
const locale = options.data.site.locale;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// # link helper
|
|
2
2
|
const {config} = require('../services/proxy');
|
|
3
|
-
const {SafeString, localUtils} = require('../services/
|
|
3
|
+
const {SafeString, localUtils} = require('../services/handlebars');
|
|
4
4
|
|
|
5
5
|
const _ = require('lodash');
|
|
6
6
|
const errors = require('@tryghost/errors');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// # link_class helper
|
|
2
2
|
const {config} = require('../services/proxy');
|
|
3
|
-
const {SafeString, localUtils} = require('../services/
|
|
3
|
+
const {SafeString, localUtils} = require('../services/handlebars');
|
|
4
4
|
|
|
5
5
|
const _ = require('lodash');
|
|
6
6
|
const errors = require('@tryghost/errors');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// ### Navigation Helper
|
|
2
2
|
// `{{navigation}}`
|
|
3
3
|
// Outputs navigation menu of static urls
|
|
4
|
-
const {SafeString, templates, hbs} = require('../services/
|
|
4
|
+
const {SafeString, templates, hbs} = require('../services/handlebars');
|
|
5
5
|
|
|
6
6
|
const errors = require('@tryghost/errors');
|
|
7
7
|
const tpl = require('@tryghost/tpl');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// ### Pagination Helper
|
|
2
2
|
// `{{pagination}}`
|
|
3
3
|
// Outputs previous and next buttons, along with info about the current page
|
|
4
|
-
const {templates, hbs} = require('../services/
|
|
4
|
+
const {templates, hbs} = require('../services/handlebars');
|
|
5
5
|
|
|
6
6
|
const errors = require('@tryghost/errors');
|
|
7
7
|
const tpl = require('@tryghost/tpl');
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// The 2nd argument is the string that will be output if the variable's value is 0
|
|
10
10
|
// The 3rd argument is the string that will be output if the variable's value is 1
|
|
11
11
|
// The 4th argument is the string that will be output if the variable's value is 2+
|
|
12
|
-
const {SafeString} = require('../services/
|
|
12
|
+
const {SafeString} = require('../services/handlebars');
|
|
13
13
|
|
|
14
14
|
const errors = require('@tryghost/errors');
|
|
15
15
|
const tpl = require('@tryghost/tpl');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Usage: `{{post_class}}`
|
|
3
3
|
//
|
|
4
4
|
// Output classes for the body element
|
|
5
|
-
const {SafeString} = require('../services/
|
|
5
|
+
const {SafeString} = require('../services/handlebars');
|
|
6
6
|
|
|
7
7
|
// We use the name post_class to match the helper for consistency:
|
|
8
8
|
module.exports = function post_class() { // eslint-disable-line camelcase
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
// Example usages
|
|
3
3
|
// `{{#prev_post}}<a href ="{{url}}>previous post</a>{{/prev_post}}'
|
|
4
4
|
// `{{#next_post}}<a href ="{{url absolute="true">next post</a>{{/next_post}}'
|
|
5
|
-
const {api
|
|
6
|
-
const {hbs} = require('../services/
|
|
5
|
+
const {api} = require('../services/proxy');
|
|
6
|
+
const {hbs} = require('../services/handlebars');
|
|
7
|
+
const {checks} = require('../services/data');
|
|
7
8
|
|
|
8
9
|
const logging = require('@tryghost/logging');
|
|
9
10
|
const tpl = require('@tryghost/tpl');
|
|
@@ -50,8 +51,8 @@ const buildApiOptions = function buildApiOptions(options, post) {
|
|
|
50
51
|
};
|
|
51
52
|
|
|
52
53
|
/**
|
|
53
|
-
* @param {*} options
|
|
54
|
-
* @param {*} data
|
|
54
|
+
* @param {*} options
|
|
55
|
+
* @param {*} data
|
|
55
56
|
* @returns {Promise<any>}
|
|
56
57
|
*/
|
|
57
58
|
const fetch = function fetch(options, data) {
|
|
@@ -84,7 +85,7 @@ const fetch = function fetch(options, data) {
|
|
|
84
85
|
// then the promise is handled in the api call.
|
|
85
86
|
|
|
86
87
|
/**
|
|
87
|
-
* @param {*} options
|
|
88
|
+
* @param {*} options
|
|
88
89
|
* @returns {Promise<any>}
|
|
89
90
|
*/
|
|
90
91
|
module.exports = function prevNext(options) {
|
|
@@ -58,6 +58,7 @@ module.exports = function price(planOrAmount, options) {
|
|
|
58
58
|
}
|
|
59
59
|
options = options || {};
|
|
60
60
|
options.hash = options.hash || {};
|
|
61
|
+
// NOTE: potentially breaking place once site.lang is removed in favor of site.locale
|
|
61
62
|
const {currency, numberFormat = 'short', currencyFormat = 'symbol', locale = _.get(options, 'data.site.lang', 'en')} = options.hash;
|
|
62
63
|
if (plan) {
|
|
63
64
|
return formatter({
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// Returns a string of the products with access to the post.
|
|
5
5
|
// By default, products are separated by commas.
|
|
6
6
|
const {labs} = require('../services/proxy');
|
|
7
|
-
const {SafeString} = require('../services/
|
|
7
|
+
const {SafeString} = require('../services/handlebars');
|
|
8
8
|
|
|
9
9
|
const isString = require('lodash/isString');
|
|
10
10
|
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
//
|
|
11
11
|
// Returns estimated reading time for post
|
|
12
12
|
|
|
13
|
-
const {checks} = require('../services/
|
|
14
|
-
const {SafeString} = require('../services/
|
|
13
|
+
const {checks} = require('../services/data');
|
|
14
|
+
const {SafeString} = require('../services/handlebars');
|
|
15
15
|
|
|
16
16
|
const {readingTime: calculateReadingTime} = require('@tryghost/helpers');
|
|
17
17
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// because often other helpers need that (t) returns a string to be able to work as subexpression; e.g.:
|
|
11
11
|
// {{tags prefix=(t " on ")}}
|
|
12
12
|
|
|
13
|
-
const {themeI18n} = require('../services/
|
|
13
|
+
const {themeI18n} = require('../services/handlebars');
|
|
14
14
|
|
|
15
15
|
module.exports = function t(text, options) {
|
|
16
16
|
const bindings = {};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
//
|
|
7
7
|
// Note that the standard {{#each tags}} implementation is unaffected by this helper
|
|
8
8
|
const {urlService} = require('../services/proxy');
|
|
9
|
-
const {SafeString, escapeExpression, templates} = require('../services/
|
|
9
|
+
const {SafeString, escapeExpression, templates} = require('../services/handlebars');
|
|
10
10
|
|
|
11
11
|
const isString = require('lodash/isString');
|
|
12
12
|
const ghostHelperUtils = require('@tryghost/helpers').utils;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// Returns a string of the tiers with access to the post.
|
|
5
5
|
// By default, tiers are separated by commas.
|
|
6
6
|
const {labs} = require('../services/proxy');
|
|
7
|
-
const {SafeString, escapeExpression} = require('../services/
|
|
7
|
+
const {SafeString, escapeExpression} = require('../services/handlebars');
|
|
8
8
|
|
|
9
9
|
const isString = require('lodash/isString');
|
|
10
10
|
|