Skip to content

Sidebar sorting does not account for short-title in front matter #201

Open
@dipikabh

Description

@dipikabh

What information was incorrect, unhelpful, or incomplete?

When using type: listSubPages in the sidebar YAML, items in the sidebar are sorted in the alphabetical order of their titles. This is the default behavior.

However, this sorting does not consider short-title for sorting even though short-title is what's actually displayed in the sidebar. The sorting still uses title even if short-title is present.

Check out this demo commit that uses type: listSubPages: dipikabh/content@dea9711. This produces the following sorting in the sidebar:

sidebar-bug-sorting-short-title

For context, these pages have the following titles and short-titles in their front matters:

title short-title slug
HTML cheatsheet for syntax and common tasks HTML cheatsheet Web/HTML/Guides/Cheatsheet
Using HTML comments Comments Web/HTML/Guides/Comments
Using HTML form validation and the Constraint Validation API Constraint validation Web/HTML/Guides/Constraint_validation
Content categories - Web/HTML/Guides/Content_categories
Using date and time formats in HTML Date and time formats Web/HTML/Guides/Date_and_time_formats
Using microdata in HTML Microdata Web/HTML/Guides/Microdata
Using microformats in HTML Microformats Web/HTML/Guides/Microformats
Understanding quirks and standards modes Quirks and standards modes Web/HTML/Guides/Quirks_mode_and_standards_mode
Using responsive images in HTML Responsive images Web/HTML/Guides/Responsive_images
Using the viewport meta element Viewport meta element Web/HTML/Guides/Viewport_meta_element

What did you expect to see?

  • Expected to see the following ordering in the sidebar when using listSubPages:
Comments
Constraint validation
Content categories
Date and time formats
HTML cheatsheet
Microdata
Microformats
Quirks and standards modes
Responsive images
Viewport meta element
  • If a page defines a short-title, that should be used for sorting along with other pages that have only title defined, so that alphabetical ordering happens regardless of which field is present in the front matter.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

The problem I'm reporting here is not on the site, I observed this when I earlier used type: listSubPages.

The list under "Guides" section in the HTML sidebar has now been manually ordered (in this PR) to list more familiar tasks first and niche or advanced topics later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageTriage needed by staff and/or partners. Automatically applied when an issue is opened.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions