I cannot find documentation for #addHtmlAttributeHook anywhere, including at the WebApp documentation here: WebApp | Docs. Can anyone point me to the docs or can the docs be updated? Thanks!
I think this isn’t formally documented, it’s only mentioned in passing in the SSR example on the WebApp docs page. The best reference is the source itself:
WebApp.addHtmlAttributeHook(hook) registers a function that runs on every request. It receives a categorized request object and returns null or a plain object, and the returned attributes get applied to the <html> tag.
A common use is setting lang, which I did in a template I created a few years ago:
Meteor.startup(() => {
WebApp.addHtmlAttributeHook(() => ({ lang: 'en' }));
});
It’d be a nice small PR to the docs.
2 Likes
omw for the docs boss ![]()
1 Like
Feel free to do it, I haven’t had time to do it yet ![]()
3 Likes