cryogen-project / cryogen

A simple static site generator written in Clojure
http://cryogenweb.org/
Eclipse Public License 1.0
1.09k stars 96 forks source link

Auto-refresh feature doesn't work with Nucleus template. #251

Open jumarko opened 2 years ago

jumarko commented 2 years ago

As discussed on Slack (https://clojurians.slack.com/archives/C0M8UK760/p1644436501870119?thread_ts=1644318541.889299&cid=C0M8UK760) the ring's auto-refresh functionality doesn't work because nucleaus uses custom window.onload function.

I fixed this in my clone by commenting out this portion of the Nucleus template: https://github.com/curiousprogrammer-net/curiousprogrammer.blog/pull/27/commits/fe121413844ea761f0eedffc94c6ccc18c8c7e6e However, I'm not sure what's the proper way to do this generically so I've just created this issue without submitting a PR.

holyjak commented 2 years ago

IMO the correct fix would be to call also the previous onload:

const oldOnload = window.onload;
window.onload = () => { if (oldOnload) oldOnload(); externalLinks(); }

would you care to send a Pr with that? 🙏