Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor – How to use template helpers inside <head> element?

I want to be able to use Meteor template helpers to dynamically specify the content of a <meta> tag. It seems like there is no way to do this.

If I put the <meta> tag in a free-floating <head> element (i.e. not in a template), both will be included correctly in the HTML, but I can't use template helpers.

If I move the <meta> to a template, and try to render the template within a free-floating <head> element, it complains.

And if I move the whole <head> element into a template, now I have a <head> block nested within the <body>, which is ugly, and I suspect invalid HTML (though Chrome seems to handle it gracefully).

Is there a solution?

like image 724
Zach Avatar asked Apr 25 '14 23:04

Zach


1 Answers

It is not currently possible to this without post load insertion due to they way Meteor parses templates

like image 132
Kelly Copley Avatar answered Nov 01 '22 02:11

Kelly Copley