-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New script
s not executed on subsequent loads
#46
Comments
I'll leave this issue open until documentation for this is live, which I'll leave until the new website is live, which should happen very soon. In the meantime, load your For any normal purposes though, just put the scripts at the top of the template (or at the end if they can run after the page is rendered). |
I also haven't confirmed this behavior on browsers other than Firefox, it's worth noting. |
* feat(website): ✨ added basic website boilerplate * chore: 🔧 added automatic reloading to site dev scripts * feat(website): ✨ added tailwindcss * feat(website): ✨ added initial landing page * feat(website): ✨ added landing page * chore(website): 🔧 make browsersync allow non-extensioned files * feat(website): ✨ added comparisons page and improved mobile support on landing page * refactor(book): ♻️ refactored book for website deployment * refactor(book): ♻️ refactored book for i18n * refactor(book): ♻️ refactored docs for new links systems * feat(website): ✨ created basic docs system with generation No styling yet at all, but the pages are all generated. * feat(website): ✨ added docs stability system No proper diplaying yet though. * refactor(book): ♻️ removed `no_run` directives in docs * refactor(book): ♻️ corrected titles in `SUMMARY.md` files * feat(website): ✨ created a docs system * feat(website): ✨ added docs version switcher * refactor(book): ♻️ made all line includes use new directive `#lines_include` * feat(website): ✨ added code including Can't include specific lines yet though. * feat(website): ✨ added support for including specific lines * docs(book): ✏️ fixed 'amlagamation' typo * fix(website): 🐛 fixed prism load failures Caused by #46. * feat(website): ✨ created placeholder for comparisons page Needs to be more mobile-friendly, that'll come soon. * chore: 🔧 added `rust-toolchain` for netlify * chore(website): 📦 added `pkg/` to build temporarily This might rectify Netlify deployment issues. * chore(website): 🙈 removed `pkg/` Abandoning Netlify for this. * fix(website): 🐛 fixed docs version switcher in dark mode * fix(website): 🐛 fixed status messages in dark mode * chore(website): 🔧 added bonnie script to deploy site * ci(website): 👷 added ci build for website * ci(website): 💚 fixed ci for tailwindcss We now use `npx` for the production build. * refactor(website): 🚨 silenced linter warnings for comparisons page placeholder Removed `components/comparisons.rs` from the module, but kept the file. * ci(website): 💚 fixed ci by adding `npm install` stage * ci(website): 👷 updated ci build for full deployment * docs: 📝 added warning notice to readme about switch to website
Describe the bug
Any
<script>
tags specified through Perseus via.head()
will not be loaded when the page changes. This results in unexpected behaviors like syntax highlighting scripts only working once the page is fully reloaded, and needs to be documented.To Reproduce
Steps to reproduce the behavior:
Expected behavior
The scripts should run, or this should be documented.
Environment (please complete the following information):
Additional context
This appears to be because Perseus uses
.set_inner_html()
to set the new<head>
, and browsers will only load new scripts if they're added with.append_child()
(web-sys
functions). This is likely infeasible without considerable rendering changes or additional overhead, so this behavior should be copiously documented so we don't leave users in the dark on this, because it is extremely difficult to debug without knowledge of how Perseus handles subsequent loads.The text was updated successfully, but these errors were encountered: