Open mtstickney opened 8 years ago
shouldn't the plugin just wait the dom to be ready in order to have all deps loaded correctly?
Not in this case. The github script is already using $.domReady()
, but $
hasn't been defined yet, so the handler doesn't even get registered. You'd need to load that script before the plugins in any case (I think that's uh... ender.js, maybe?).
At the very least ender.js should be moved into <head>
; moderizr and octopress.js might not technically need it, but it's safe to move them as well, and I don't think there's much downside.
As far as I can tell the original Octopress theme has these scripts in the
section.I think you're mistaken: _include/head.html has modernizr, octopress.js, and ender.js all loaded in <head>
(that's the 2.0 tag, the 2.5 branch is the same except they're using jquery instead of ender.js). It's also pretty easy to verify empirically: move the scripts into <head>
or above the sidebar include and the plugin works; don't, and it doesn't.
@mtstickney I meant <head>
but wiki escaping failed me :(
I see, apologies for misunderstanding (still probably good to have the reference, though).
Body elements are loaded in the order that they are seen; by loading at the end of the body, they are not available for content that needs them, like the github plugin in the sidebar. For the github plugin, this results in a '$ is not defined' error and the repo list is never updated. Moving the scripts to
ensures the scripts are loaded before dependent content.Update: note that this fixes #79.