Meteor.js: global <head> attributes with iron router

Iron:router can use a default layout template to define what every page looks like. Very comfy.

    layoutTemplate: 'layout'

But then how do we set the global title and make the site mobile friendly with <head> attributes?

Just create a head.html (or index.html or whatever name) file in the client folder and enter the head there

    <title>My Website</title>
    <meta name="viewport" content="width=0, initial-scale=0.7, user-scalable=no">
    <link rel="icon" sizes="16x16" href="/favicon.ico?v=2">

Was this of any help to you? :)

Krister Viirsaar

Read more posts by this author.

Subscribe to Krister's coding adventures

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!