Skip to content
This repository has been archived by the owner on Jan 25, 2019. It is now read-only.

{{ site.categories }} template tag #24

Closed
robatron opened this issue May 16, 2011 · 4 comments
Closed

{{ site.categories }} template tag #24

robatron opened this issue May 16, 2011 · 4 comments
Labels
Milestone

Comments

@robatron
Copy link
Contributor

Have a {{ site.categories }} template tag that returns a list of categories and their associated pages, e.g., {{ site.categories['blog'] }} would return all pages with the category 'blog'.

@mythmon
Copy link
Owner

mythmon commented May 16, 2011

You read my mind. This is part of the "making templates nicer" thing i was going to work on soon.

@robatron
Copy link
Contributor Author

Cool. This would be handy to make little "most recent" boxes for different types of content, e.g., recent blog entries or tweets :)

@mythmon
Copy link
Owner

mythmon commented May 22, 2011

This is done in githead / 0.4. site.categories is a dictionary with keys of the top level categories and values a list of the pages directly underneath them. That is, if you have a page with a category blog, that will be in the list categories['blog']. But the page with category blog/doodads will not.

@mythmon mythmon closed this as completed May 22, 2011
@robatron
Copy link
Contributor Author

Excellent, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants