Skip to content

Commit

Permalink
update 404 page
Browse files Browse the repository at this point in the history
  • Loading branch information
bdeffleyfamous committed May 8, 2024
1 parent 12cd8e3 commit 6c0d527
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
<script src="/best-cigars-guide/scripts/scripts.js" type="module" crossorigin="use-credentials"></script>
<script type="module">
import { sampleRUM } from '/best-cigars-guide/scripts/aem.js';
import { loadFragment } from '/best-cigars-guide/blocks/fragment/fragment.js';

window.addEventListener('load', () => {
window.addEventListener('load', async() => {
if (document.referrer) {
const { origin, pathname } = new URL(document.referrer);
if (origin === window.location.origin) {
Expand All @@ -27,6 +28,8 @@
}
}
sampleRUM('404', { source: document.referrer, target: window.location.href });
const main = document.querySelector('main');
main.replaceWith(await loadFragment('/best-cigars-guide/fragments/404'));
});
</script>
<link rel="stylesheet" href="/best-cigars-guide/styles/styles.css">
Expand Down

0 comments on commit 6c0d527

Please sign in to comment.