流星搜索引擎优化

Meteor search engine optimization

关注此博客 post I used this package 以设置我的 SEO。虽然页面标题正确显示在标题栏上,但当我 curl http://localhost:3000/about -4 进入网页时,我没有看到任何元标记。我正在设置与文档完全相同的所有内容,如下所示:

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."
      }
    });
  }
});

curl 没有 运行 JS。所以流星之类的东西是行不通的。您需要服务器端渲染。检查 this blog.

SEO 包修改了浏览器上的标签。这意味着如果您在浏览器中加载它。

要使用 curl 查看它,确保你有 spiderable 包,安装 phantomjs 并使用 curl http://localhost:3000/about?_escaped_fragment_=#

查看你的路线

这将强制根据 AJAX web crawling spec

使用 spiderable 包使用 phantomjs 渲染它