skip to Main Content

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


  1. curl doesn’t run JS. So meteor kind of things doesn’t work. You need server side rendering. Check this blog.

    Login or Signup to reply.
  2. 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 using curl 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search