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 'child_nav_order' front matter to be able to sort navigation pages in reverse #726
Conversation
…s in reverse Set `child_nav_order` to `desc` to reverse the sort order for a child section. Signed-off-by: John Mertic <jmertic@linuxfoundation.org>
Hi @jmertic, thanks for your contribution; we're just now getting around to triaging all the open PRs. Could you add a couple of lines of documentation explaining this new feature (I imagine in the Navigation Structure page)? Want to make sure that others know how to use your new feature! |
Signed-off-by: John Mertic <jmertic@linuxfoundation.org>
Awesome - take a look at my last commit and see if that is the right place/tone/verbiage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jmertic, thanks for the quick response (and sorry for my late one - been swamped with finals).
I think the current location of the docs is slightly misplaced - it seems like it's interrupting the "Pages with children" documentation.
My suggestion - could we instead add this as a subheading under "Pages with children" (maybe called "Ordering child pages"), and then include an example? Hopefully that shouldn't be too much work - let me know how I can help!
Signed-off-by: John Mertic <jmertic@linuxfoundation.org>
Thanks @mattxwang - I think I didn't what you were asking, let me know if that looks better. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jmertic - left two minor suggestions, but otherwise LGTM! Feel free to commit the suggestions or provide your own.
Signed-off-by: John Mertic <jmertic@linuxfoundation.org> Co-authored-by: Matt Wang <matt@matthewwang.me>
Signed-off-by: John Mertic <jmertic@linuxfoundation.org> Co-authored-by: Matt Wang <matt@matthewwang.me>
Thank you @mattxwang - accepted these great suggestions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! I think we should bundle this in to #779 then. Thank you for your contribution!
@mattxwang @jmertic What was the motivation for choosing Perhaps Moreover, the current implementation is: {%- if node.child_nav_order == 'desc' -%}
{%- assign children_list = children_list | reverse -%}
{%- endif -%} I realise this is a late suggestion, but if we're ever going to make a breaking change to this feature, v0.4.0 would be the best opportunity… Issue #827 reminded me of this. We could also support both |
Let me know if it's preferred to do the full switch, or support both but have |
Thanks for the immediate – and positive – response! Let's see what @mattxwang prefers. |
Ah - still getting back into the swing of things.
Thoughts? Hopefully should be a simple change. Thanks for catching this @pdmosses and for the quick response @jmertic! |
Created #1061 - let me know if this works. |
Set
child_nav_order
todesc
to reverse the sort order for a child section.Signed-off-by: John Mertic jmertic@linuxfoundation.org