Add our own simpler implementation of the page npm package
We don't need all the client-side routing part, we only need to be able to selectively run certain JavaScript code depending on which site the user is at the moment. This implementation is not as advanced as the one from the `page` package, or what is possible with the `url-pattern` package. But we don't need any fancy URL matching at the moment, once we do we can revisit and maybe introduce something like `url-pattern` instead of just a crude `document.location.pathname === path`.
Showing
h/static/scripts/page.js
0 → 100644
Please register or sign in to comment