Closed hariadi closed 10 years ago
Seems like this is a good use case for lo-dash templates:
links: {
date : '/:categories/:year/:month/:day/:filename'
pretty: '/:categories/:year/:month/:day/:title/index.html'
none : '/:categories/:filename'
},
options: {
permalinks: {
plugins: ['permalinks'],
pattern: '<%= links.pretty %>'
}
}
however, I was thinking the same thing as you, so it's likely we'll get this request again. should we just add a few defaults in?
:+1:
So what you suggest for default pattern?
For your own projects I would suggest just doing :category/:slug/index.html
or something like that (with slug being a custom property/replacement pattern). like this: https://github.com/assemble/permalinks#seo
Date is generally bad for SEO, but a lot of people ask for it in permalinks, so I made sure it was prominent.
Yes, IMO, :category/:slug
is great for SEO. But there is challenge when page has multi categories (default first category).
Example yfm:
title: Multi Cats
categories:
- Cat 1
- Cat 2
With conf:
options: {
permalinks: {
plugins: ['permalinks'],
pattern: 'seo', // :category/:slug
}
}
Assemble should render to different page (page.dest
become an array?):
dest + '/cat-1/multi-cats/index.html'
dest + '/cat-2/multi-cats/index.html'
Maybe this another issue.
I'm not sure, @doowb and I just had a similar conversation about the categories/index pages. How does WordPress do this? Or rather, how do you think WordPress might go about this if there wasn't a database involved?
I was just talking to @doowb and we're thinking we should probably build another "generic" plugin for indexing pages - that's all it would do. then we can always borrow some logic from that in other plugins if necessary. or even just create utils to use in other plugins for things like indexing, link building, pagination/paging, etc.
Just a thought, but I think the challenge with the index pages "muddy the waters". I'd love to neutralize that problem so we can think clearly about what we want to accomplish here.
@hariadi, see https://github.com/assemble/permalinks#preset. Let me know if this concept works for you, if so we can add more patterns. Next we'll need to decide what the patterns should be for each preset.
Great. :+1: for alias pretty
to :basename/index:html
And Assemble conf: