Skip to content
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

Add ability to sort by frontmatter parameters #3022

Merged
merged 5 commits into from Feb 10, 2017

Conversation

fj
Copy link
Contributor

@fj fj commented Feb 8, 2017

This allows users to sort by the value of a specified frontmatter key, including anything that would otherwise be available in .Params. Comparisons (and thus the resulting sorting) are done on a string basis, so, for example, xyz123 comes before and not after xyz23.

This is useful for general-purpose sorting for which weight is either not sufficient or where it duplicates information that's already present in the frontmatter. See discussions here.

If the committers are happy with this implementation, I'll also add the correspondingly necessary documentation for this feature.

Copy link
Member

@bep bep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is useful, and if you can address my comments and add a line or two in the docs, I will merge.

hugolib/pageSort.go Outdated Show resolved Hide resolved
hugolib/pageSort.go Outdated Show resolved Hide resolved
hugolib/pageSort_test.go Outdated Show resolved Hide resolved
hugolib/pageSort.go Outdated Show resolved Hide resolved
@fj
Copy link
Contributor Author

fj commented Feb 9, 2017

This should address the remarks you had earlier, @bep. Let me know how else I can help.

Copy link
Member

@bep bep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it looks right. A line in the doc and this is good o go.

@bep bep merged commit 298ebc3 into gohugoio:master Feb 10, 2017
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants