document.querySelector('main').replaceWith(postMain);
hljs.highlightAll();
}
- else if (path === '/atom.xml') {
- location.href = `${location.origin}${path}`;
- }
else {
// MUST redirect to a page where the web server serves an actual 404 error (i.e. not just
// index.html again) otherwise this triggers an infinite loop
if (location.href === url.href) {
return;
}
- // If the new page is on a different host, redirect as expected
- if (location.host !== url.host) {
+ // Redirect as expected for outside hosts or Atom feed
+ else if (location.host !== url.host || href === 'https://ardislu.dev/atom.xml') {
location.href = href;
return;
}