Closed iamstarkov closed 9 years ago
We solve this through processItem.date
hook. It uses YAML headmatter date by default if it exists. If not, you can pass a custom date. In that case you would do something like this:
paths: {
blog: {
processItem: {
date: function(o) {
// parse date from filename or something
return new Date(o.fileName.split('-').slice(0, 3).join('.'));
}
}
}
}
pretty neat, can I override it for my blog?
Yeah, that's why we have the hook. :+1:
Note that we default to sort by date (reversed) by default. As mentioned elsewhere it's possible to customize this per section. I needed to do that for my book for instance.
awsm
I suppose it's safe to close this. Let me know if you have any further issues. I'll create a FAQ entry out of this.
I suppose it's safe to close this.
sure
Minimum viable blog should have: articles and articles list. And obviously articles list should be sorted by date otherwize it’s uselss, so posts’ dates are one of the most detail for the blog. For example jekyll teach about dates on configuration step:
YEAR-MONTH-DAY-title.md
. How did you manage to extract dates from posts?