1

This seems really basic and yet I've been searching for it and can't find anything. I'm working on converting an old legacy/proprietary blog I have into Jekyll. So far it's going well and I have most things working well. I've run into an issue with generating indexs per date.

I'd like to have something like the following:

http://example.org/2012/01/03
http://example.org/2012/02/02
etc...

Where each of those paths pulls up a listing of posts for that date. So on the Jekyll side, I'd guess I'd see something like:

_site/2012/01/03/index.html
_site/2012/02/02/index.html
etc...

...where I can specify a template for generating those listing pages. How do you go about doing this in Jekyll?

djsumdog
  • 2,560
  • 1
  • 29
  • 55
  • so I'm assuming you want an index page (a list) of URLs that have the date for all posts? as well as pretty URLs that don't end in .html? Just want to be clear before I answer your question – matrixanomaly May 11 '15 at 16:52
  • I just want a page for each date that has posts, listing those posts. I don't need a list to those date/pages; already have a little javascript calendar that I got working with jekyll last night that highlights dates with posts. When you click on a date, it follows the url pattern above (which 404s right now). After reading more docs, I figured I needed to write a custom generator plugin? I was going to attempt that today. – djsumdog May 12 '15 at 00:44
  • hmm, other than using liquid tags and creating a file in each folder based on months and years I think you would need a custom ruby plugin, good luck though! (this, might help: http://jekyllrb.com/docs/posts/#displaying-an-index-of-posts)\ – matrixanomaly May 12 '15 at 03:10
  • related: http://stackoverflow.com/questions/25958652/how-to-create-a-link-to-each-category/25979472#25979472 – matrixanomaly May 12 '15 at 04:22

1 Answers1

2

Turns out there was already a plugin for this solution:

https://github.com/jekyll/jekyll-archives/

I simply followed the documentation and creating a configuration like the following:

jekyll-archives:
  enabled: ['day']
  layout: 'archive'
  permalinks:
    day: '/:year/:month/:day/'
djsumdog
  • 2,560
  • 1
  • 29
  • 55