I’m writing a package in order to poke around at some other aspects of Meteor development, and I’ve run into a roadblock. The end-goal is to insert a bit of dynamic JSON data into the
<head> tag of an app. Doing this from the client is no big deal, since I can just call
document.appendChild(), and then I can see it when I right-click and inspect the page from a browser.
But what I would really like is for it to append that data somehow before the page is rendered, from the server, so that I could right-click and ‘view page source’ and see it in the source code that’s delivered directly to the browser.
I got my fingers somewhat dirty pulling apart Build Plugins before realizing that it didn’t make sense a
<head> tag from there, since the data is user-specific. It seems like
Meteor.startup() inside the
/server directory would be the logical place for it instead, but I don’t see how to append to the existing
head if I don’t have access to
document. Is there a way to do this from the server’s startup() method, or another route I should look into?