guncebektas / meteor-friendly-slugs

Meteor package to generate URL friendly slugs from a field with auto-incrementation to ensure unique URLs.
65 stars 15 forks source link

How to use momentjs to create date slug? #20

Closed 55 closed 8 years ago

55 commented 9 years ago

Looking for a way to use momentjs to create slug with pretty date.

Having this options now:


Collection.friendlySlugs([
  {
    slugFrom: 'title',
    slugField: 'slug',
  },
  {
    slugFrom: 'createdAt',
    slugField: 'date',
  }
]);

In routes.js:

path: '/posts/:date-:slug',