// basic
function basicUrlify(post) {
return post.category + '/' + slugify(post.title);
}
// multiple urls per post
function multipleUrlify(post) {
return [
post.category + '/' + slugify(post.title),
dateify(post.date) + '/' + slugify(post.title)
];
}
// redirect
function redirectUrlify(post) {
var to = dateify(post.date) + '/' + slugify(post.title);
return [
{
from: post.category + '/' + slugify(post.title),
to: to,
},
to,
];
}
You would just have one of these mappings somewhere in the project configuration. The nice thing is that it's very flexible and you can do 1-1, N-1 type of mappings and even rerouting (last case).
Example:
You would just have one of these mappings somewhere in the project configuration. The nice thing is that it's very flexible and you can do 1-1, N-1 type of mappings and even rerouting (last case).