ayal / headly

meteor package to handle facebookexternalhit responses (for og:metatags use)
28 stars 7 forks source link

headly

meteor package to handle external service requests to generate metatag responses (for og:metatags use)

Install

Use meteorite

Then add headly to your meteor app using:

mrt add headly

... or ... you can clone the code to your meteor/packages directory manually

config headly

In your server code use something like:

Meteor.headly.config({
    data: function(req){
      //do something dynamic here, i.e get title from db based on url param
      return {title: dynamic.title};
    },
    facebook: function(data) {
      return '<meta property="og:title" content="'+data.title+'" />';
    },
    twitter: function(data) {
      return '<meta name="twitter:card" content="summary"> ';
}});

.. or try the example first to get the hang of it: