Skip to content

Collections for directory indexes #502

Description

@ollicle

While attempting to translate my old Moveable Type generated blog to 11ty I’ve hit a snag. The posts appear in directories based on post dates e.g.
/2014/jan/04/eg-post-1.html

Each of these sub directories include indexes which list the posts whose date shares the same year, month, day. Example of the desired file output:

/2014/
	index.html  <= (lists: eg-post-1.html, eg-post-2.html, eg-post-3.html, eg-post-4.html)
	jan/
		index.html  <= (lists: eg-post-1.html, eg-post-2.html, eg-post-3.html)
		04/
			index.html  <= (lists: eg-post-1.html)
			eg-post-1.html
		05/
			index.html  <= (lists: eg-post-2.html, eg-post-3.html)
			eg-post-2.html
			eg-post-3.html
	feb/
		index.html  <= (lists: eg-post-4.html)
		25/
			index.html  <= (lists: eg-post-4.html)
			eg-post-4.html

So far I’ve attempted to do this by iterating over a large set of years/months/days, creating a glob based collection for each. By deriving the collection names from the date I hoped to later correlate these collections with each index template via its inputPath.

This is not working, but aside from that, generating these collections is really slow which makes it impractical anyway.

Is there a more effective approach to generate directory indexes for date derived sub directories with 11yt?

Thanks in advance for your ideas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions