@quintype/framework 7.34.3-test-jsembed.1 → 7.34.4-455-duplicate.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/CHANGELOG.md +7 -0
- package/package.json +2 -2
- package/server/amp/handlers/story-page.js +4 -1
- package/server/routes.js +21 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [7.34.3](https://github.com/quintype/quintype-node-framework/compare/v7.34.2...v7.34.3) (2025-07-07)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **jsembed:** fallback support for non-iframe elements ([#466](https://github.com/quintype/quintype-node-framework/issues/466)) ([42aab83](https://github.com/quintype/quintype-node-framework/commit/42aab83cd73acb893bad209d365a4fc728c32c48))
|
|
11
|
+
|
|
5
12
|
### [7.34.2](https://github.com/quintype/quintype-node-framework/compare/v7.34.1...v7.34.2) (2025-06-25)
|
|
6
13
|
|
|
7
14
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quintype/framework",
|
|
3
|
-
"version": "7.34.
|
|
3
|
+
"version": "7.34.4-455-duplicate.0",
|
|
4
4
|
"description": "Libraries to help build Quintype Node.js apps",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"engines": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@ampproject/toolbox-optimizer": "2.8.3",
|
|
34
34
|
"@grpc/grpc-js": "^1.12.5",
|
|
35
35
|
"@jsdoc/salty": "^0.2.9",
|
|
36
|
-
"@quintype/amp": "^2.
|
|
36
|
+
"@quintype/amp": "^2.22.0-468-duplicate.2",
|
|
37
37
|
"@quintype/backend": "^2.7.0",
|
|
38
38
|
"@quintype/components": "^3.5.0",
|
|
39
39
|
"@quintype/prerender-node": "^3.2.26",
|
|
@@ -57,7 +57,10 @@ async function ampStoryPageHandler(
|
|
|
57
57
|
const story = await Story.getStoryBySlug(client, req.params["0"]);
|
|
58
58
|
const isAmpDisabled = get(story, ["metadata", "story-attributes", "disable-amp-for-single-story", "0"], "false");
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
const getDisableAmpUnit = get(opts, ["disableAmpUnit"], false);
|
|
61
|
+
const disableAmpUnit = typeof getDisableAmpUnit === "function" && opts.disableAmpUnit(story);
|
|
62
|
+
|
|
63
|
+
if (disableAmpUnit || (!isVisualStory && (!enableAmp || isAmpDisabled === "true"))) {
|
|
61
64
|
const ampPageBasePath = getAmpPageBasePath(opts, config);
|
|
62
65
|
const redirectUrl = `/${req.params[0]}`.startsWith(ampPageBasePath)
|
|
63
66
|
? `/${req.params[0]}`.replace(ampPageBasePath, "")
|
package/server/routes.js
CHANGED
|
@@ -680,6 +680,27 @@ exports.mountQuintypeAt = function (app, mountAt) {
|
|
|
680
680
|
* To disable amp version for a specific story, you need to create a story attribute in bold with the slug {disable-amp-for-single-story} and values {true} and {false}. Set its value to "true" in the story which you want to disable amp. Please make sure to name the attributes and values in the exact same way as mentioned
|
|
681
681
|
* attribute slug: "disable-amp-for-single-story" values: "true" , "false". This will redirect '<amp-page-base-path>/:slug' to the non-amp page
|
|
682
682
|
*
|
|
683
|
+
* To disable the AMP version for a specific story template or section, pass opts.disableAmpUnit as a function that always returns a boolean value. When the function returns true, AMP will be disabled for the specified scenario.
|
|
684
|
+
* Note: Ensure that disableAmpUnit is always a function and returns a boolean value, as demonstrated below.
|
|
685
|
+
*
|
|
686
|
+
* Under app/server/app.js
|
|
687
|
+
*
|
|
688
|
+
* ``` const getTemplate = (story) => {
|
|
689
|
+
* return story.["story-template"] === "template-name";
|
|
690
|
+
* };
|
|
691
|
+
*
|
|
692
|
+
* ....
|
|
693
|
+
*
|
|
694
|
+
* ampRoutes(app, {
|
|
695
|
+
* seo: generateSeo,
|
|
696
|
+
* disableAmpUnit: (story) => getTemplate(story),
|
|
697
|
+
* featureConfig: {
|
|
698
|
+
* .....
|
|
699
|
+
* }
|
|
700
|
+
* ...
|
|
701
|
+
* .....
|
|
702
|
+
* })```
|
|
703
|
+
*
|
|
683
704
|
* @param {Express} app Express app to add the routes to
|
|
684
705
|
* @param {Object} opts Options object used to configure amp. Passing this is optional
|
|
685
706
|
* @param {Object} opts.templates An object that's used to pass custom templates. Each key corresponds to the template name and corresponding value is the template
|