@quintype/framework 7.25.0 → 7.25.1-fix-ampstories-404.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/package.json
CHANGED
|
@@ -41,7 +41,7 @@ async function ampStoryPageHandler(
|
|
|
41
41
|
) {
|
|
42
42
|
try {
|
|
43
43
|
const opts = cloneDeep(rest);
|
|
44
|
-
const isCorrectAmpPath = req.path.startsWith(`${getAmpPageBasePath(opts, config)}/`);
|
|
44
|
+
const isCorrectAmpPath = req.path.startsWith(`${getAmpPageBasePath(opts, config)}/`) || isVisualStory;
|
|
45
45
|
if (!isCorrectAmpPath) {
|
|
46
46
|
return next();
|
|
47
47
|
}
|
|
@@ -55,7 +55,7 @@ async function ampStoryPageHandler(
|
|
|
55
55
|
const story = await Story.getStoryBySlug(client, req.params["0"]);
|
|
56
56
|
const isAmpDisabled = get(story, ["metadata", "story-attributes", "disable-amp-for-single-story", "0"], "false");
|
|
57
57
|
|
|
58
|
-
if (
|
|
58
|
+
if (!isVisualStory && (!enableAmp || isAmpDisabled === "true")) {
|
|
59
59
|
const ampPageBasePath = getAmpPageBasePath(opts, config);
|
|
60
60
|
const redirectUrl = `/${req.params[0]}`.startsWith(ampPageBasePath)
|
|
61
61
|
? `/${req.params[0]}`.replace(ampPageBasePath, "")
|