docpad / docpad-plugin-dateurls

DocPad plugin that adds support for date based URLs to DocPad

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generate year, month and day-based links

ndarilek opened this issue · comments

One feature I'm missing in Docpad is generation of links like so:

  • /2009: All posts in 2009
  • /2009/07: July 2009
  • /2009/07/01: Posts on July 1

I'm attempting to add this in my config by hooking into events, but I'm not immediately sure of the Docpad way of doing this.

What might be nice are dayView, monthView and yearView configuration options that return a document template for each year, month and day. Maybe the current plugin can add documents to date-based arrays which these templates have access to, to avoid having to perform another findLive. I'm sure it isn't hard to implement, I'm just not sure what the most efficient way is, and it makes sense as part of the current dateurls plugin I'd think. It might also make sense to have a next/previous day/month/year helper for linking to the previous/next period of time with posts.

Thanks!

Thanks for the suggestion. It may make sense to build a new extension for this functionality. I'll consider it.