thegetty / quire

A multi-package repository for the Quire multiformat publishing framework
https://quire.getty.edu/
BSD 3-Clause "New" or "Revised" License
92 stars 12 forks source link

`sort_as` not working with contributor ids in page YAML #854

Open Erin-Cecele opened 11 months ago

Erin-Cecele commented 11 months ago

Before proceeding, make sure there isn’t an existing issue for this bug.

Expected Behavior

When you add sort_as under contributor ids in the page YAML it should sort them according to the desired order.

Actual Behavior

Adding sort_as under contributor ids in the page YAML has no effect on the ordering.

Steps to Reproduce

  1. Start a new Quire project
  2. Add contributors to the publication.yaml
  3. List contributor ids in the essay.md page YAML
  4. Add sort_as to the contributors to override the alphabetical ordering and check to see if it changed the ordering

Version Numbers

[Project] quire-cli 1.0.0-rc.10 quire-11ty 1.0.0-rc.14 starter /Users/edunigan/GitHub/quire-starter-minimal@2.6.0 [System] quire-cli 1.0.0-rc.10 node v18.16.0 npm 9.5.1 os Darwin 21.6.0

Web Browser

Chrome Version 117.0.5938.88 (Official Build) (x86_64)

Relevant Terminal/Shell Output

N/A

Supporting Information

Screen Shot 2023-10-06 at 2 23 12 PM
Erin-Cecele commented 11 months ago

This came up with Inventories and Surveys: https://github.com/thegetty/inventories-and-surveys/issues/13 and Bronze Guidelines: https://github.com/thegetty/bronze-guidelines/issues/64

geealbers commented 9 months ago

The fix I found that worked in the Bronze Guidelines book was a single line adding the sort_as value in the getContributor filter:

  // Add local sort_as value if one is provided
  item.sort_as ? contributor.sort_as = item.sort_as : ''