Skip to content

Commit

Permalink
Issue stephenou#58 : Update getPage() to have .slice(1)
Browse files Browse the repository at this point in the history
Currently `getPage` returns `location.pathname.slice(-32)`
 This raises `slug` to not found when the pathname is longer
  • Loading branch information
partham16 committed Oct 29, 2020
1 parent 5bc77e0 commit 6b86774
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class BodyRewriter {
PAGE_TO_SLUG[page] = slug;
});
function getPage() {
return location.pathname.slice(-32);
return location.pathname.slice(1);
}
function getSlug() {
return location.pathname.slice(1);
Expand Down

0 comments on commit 6b86774

Please sign in to comment.