New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort items of a collection #67

Closed
yosymfony opened this Issue Feb 4, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@yosymfony
Copy link
Member

yosymfony commented Feb 4, 2016

Items of a collection can be sorted with two new attributes with special meaning defined at the collection section of config.yml file of a Spress site

collections:
    posts:
        sort_by: 'date'
    projects:
        sort_by: 'title'
        sort_type: 'ascending'
  • sort_by: the name of the attribute used as criteria to sort.
  • sort_type: values accepted: ascending or descending that last one by default.

Default values

Items of posts collection are sorted by descending date attribute.
Variables site.categories and site.tags are affected by posts sorting.

Additional tasks

Deals with issue #63

yosymfony added a commit that referenced this issue Feb 4, 2016

yosymfony added a commit to spress/spress.yosymfony.com that referenced this issue Mar 23, 2016

yosymfony added a commit to spress/spress.yosymfony.com that referenced this issue Mar 23, 2016

@yosymfony yosymfony closed this Mar 26, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment