{"action":"opened","issue":{"url":"https://api.github.com/repos/metafizzy/infinite-scroll/issues/827","repository_url":"https://api.github.com/repos/metafizzy/infinite-scroll","labels_url":"https://api.github.com/repos/metafizzy/infinite-scroll/issues/827/labels{/name}","comments_url":"https://api.github.com/repos/metafizzy/infinite-scroll/issues/827/comments","events_url":"https://api.github.com/repos/metafizzy/infinite-scroll/issues/827/events","html_url":"https://github.com/metafizzy/infinite-scroll/issues/827","id":355325449,"node_id":"MDU6SXNzdWUzNTUzMjU0NDk=","number":827,"title":"Infinitely load articles with updateNextUrl","user":{"login":"fourjuaneight","id":13276705,"node_id":"MDQ6VXNlcjEzMjc2NzA1","avatar_url":"https://avatars3.githubusercontent.com/u/13276705?v=4","gravatar_id":"","url":"https://api.github.com/users/fourjuaneight","html_url":"https://github.com/fourjuaneight","followers_url":"https://api.github.com/users/fourjuaneight/followers","following_url":"https://api.github.com/users/fourjuaneight/following{/other_user}","gists_url":"https://api.github.com/users/fourjuaneight/gists{/gist_id}","starred_url":"https://api.github.com/users/fourjuaneight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fourjuaneight/subscriptions","organizations_url":"https://api.github.com/users/fourjuaneight/orgs","repos_url":"https://api.github.com/users/fourjuaneight/repos","events_url":"https://api.github.com/users/fourjuaneight/events{/privacy}","received_events_url":"https://api.github.com/users/fourjuaneight/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-29T20:43:12Z","updated_at":"2018-08-29T20:43:12Z","closed_at":null,"author_association":"NONE","body":"I'm using infinite scroll with Hugo and attempting to apply it to the single article template. That is, infinitely load articles, one after the other. I've read through a few older issues and understand the limitations of doing this (i think).\r\n\r\nWith that said, I am able to provide a Next Article link at the bottom of each article using the static site generators functionality. Infinite Scroll can catch this and load another article, but just one. That's because the next article link doesn't update with the following article.\r\n\r\nI _belive_ I can circumvent this using `updateNextURL` as shown [here](https://infinite-scroll.com/extras.html#loading-urls-from-loaded-pages). But, I'm not using jQuery and can't seem to get this to work with vanilla JS. This is my code:\r\n\r\n```\r\nfunction updateNextURL(doc) {\r\n  nextURL = doc.getElementsByClassName('article__next').href;\r\n}\r\n\r\nupdateNextURL(document);\r\n\r\nvar infScroll = new InfiniteScroll('.single-list', {\r\n  path: function () {\r\n    return nextURL\r\n  },\r\n  append: '.post',\r\n  hideNav: '.pagination',\r\n  history: 'replace',\r\n});\r\n\r\ninfScroll.on('load.infiniteScroll', function (event, response) {\r\n  updateNextURL(response);\r\n});\r\n```\r\n\r\nI get a console error disabling infinite scroll:\r\n```\r\nDisabling InfiniteScroll\r\nproto.create @ ils-bundle.min.74025c212987b18c76b383adbdbe9ab758861e98241950f9ac6c9be1098dd358.js:formatted:398\r\nInfiniteScroll @ ils-bundle.min.74025c212987b18c76b383adbdbe9ab758861e98241950f9ac6c9be1098dd358.js:formatted:381\r\n(anonymous) @ (index):398\r\n```\r\nI'd like to point out that my JS is crap and this is mostly put together based on Google searches and some luck. \r\n"}}
{"actor":{"display_login":"fourjuaneight"}}