如何使用流路由器生成SEO友好的URL?

时间:2015-12-06 23:45:05

标签: meteor

我正在开发一个需要一些SEO站点的应用程序。对于初学者来说,获得基于文档标题生成的slug类型搜索引擎友好URL会很好。有没有人知道任何图书馆或方法来做到这一点?

其次根据我的阅读,似乎如果一个人想要更好的SEO,他/她得到铁路由器,因为有一些第三方包似乎有助于(蜘蛛等)。此外,通过生成标题和元标记,铁路由器也很容易。这是一个真实的假设吗?

1 个答案:

答案 0 :(得分:1)

如果您使用simple schema,那么您可以执行以下操作:

Posts.attachSchema new SimpleSchema
  title:
    type: String
  content:
    type: String
  url:
    type: String
    autoValue: ->
      title = @field('title')
      unless title.isSet then return
      someEscapeFunction(title.value.substring(0, 120))

并在路由器

中将url作为path param传递