Skip to content

Commit

Permalink
Issue - relative URL for attribute 'src' in 'amp-next-page' is disall…
Browse files Browse the repository at this point in the history
…owed (#396)

* Fix. Pass absolute path to src attribute of amp-next-page
  • Loading branch information
VeenaYemmiganur authored Oct 17, 2022
1 parent 07ef41a commit 8ccc1c4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs-src/tutorials/opts.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const myOptsObj = {
infiniteScroll: {
source: "custom",
inlineConfig: async getCustomStoryList(){},
remoteConfigEndpoint: "/amp/api/infinite-scroll",
remoteConfigEndpoint: "amp/api/infinite-scroll",
}
},
};
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@quintype/amp",
"version": "2.6.0",
"version": "2.6.1-afk-amp-rel-url-issue.0",
"description": "Quintype's AMP component library for publisher apps to create amp layouts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
5 changes: 3 additions & 2 deletions src/atoms/infinite-scroll/infinite-scroll.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ export const StyledSeparator = styled.div`

export const InfiniteScrollBase = ({ story, config, children, inlineConfig, ...props }: InfiniteScrollTypes) => {
const { "story-content-id": storyId } = story;
const { "sketches-host": host } = config.publisherConfig;
const remoteEndPoint = get(
config,
["opts", "featureConfig", "infiniteScroll", "remoteConfigEndpoint"],
"/amp/api/v1/amp-infinite-scroll"
"amp/api/v1/amp-infinite-scroll"
);
const jsonConfigUrl = `${remoteEndPoint}?story-id=${storyId}`;
const jsonConfigUrl = `${host}/${remoteEndPoint}?story-id=${storyId}`;
const infiniteScrollRender = get(config, ["opts", "render", "infiniteScrollRender"], null);
const storySeparatorText = get(
config,
Expand Down

0 comments on commit 8ccc1c4

Please sign in to comment.