Following this blog post I used this package to setup my SEO. While the page title shows up correctly on the title bar, when I curl http://localhost:3000/about -4
into the webpage I don’t see any meta tags. I am setting up everything exactly the same as the document as below:
Router.route('/about', {
'name': 'About',
'action': function() {
this.render('About', {
to: 'content'
});
},
'onAfterAction': function() {
if (!Meteor.isClient) {
return;
}
SEO.set({
title: "My website",
meta: {
'description': "testing."
}
});
}
});
2
Answers
curl
doesn’t run JS. So meteor kind of things doesn’t work. You need server side rendering. Check this blog.The
SEO
package modifies the tags on-browser. This means it’s if you load it up in your browser.To view it using curl make sure you have the
spiderable
package in, phantomjs installed and view your route usingcurl http://localhost:3000/about?_escaped_fragment_=#
This will force it to be rendered using phantomjs using the spiderable package as per the AJAX web crawling spec