Skip to content

Commit

Permalink
Website Listing - No duplication authors
Browse files Browse the repository at this point in the history
Uniquefy authors displayed - ensure that we don’t end up with duplicate entries

Addresses #8860
  • Loading branch information
dragonstyle committed Feb 23, 2024
1 parent 2429ae2 commit 478b3df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions news/changelog-1.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ All changes included in 1.5:
- ([#8435](https://github.com/quarto-dev/quarto-cli/issues/8435)): Improve listing filtering using special characters
- ([#8627](https://github.com/quarto-dev/quarto-cli/issues/8627)): Localize the text that appears as placeholder in listing filters.
- ([#8715](https://github.com/quarto-dev/quarto-cli/issues/8715)): Listings should respect `image: false`
- ([#8860](https://github.com/quarto-dev/quarto-cli/discussions/8860)): Don't show duplicate author names.

## Manuscripts

Expand Down
8 changes: 5 additions & 3 deletions src/project/types/website/listing/website-listing-read.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
join,
relative,
} from "path/mod.ts";
import { cloneDeep, orderBy } from "../../../../core/lodash.ts";
import { cloneDeep, orderBy, uniq } from "../../../../core/lodash.ts";
import { existsSync } from "fs/mod.ts";

import { Format, Metadata } from "../../../../config/types.ts";
Expand Down Expand Up @@ -1117,8 +1117,10 @@ async function listItemFromFile(
);
}
const author = structuredAuthors
? structuredAuthors.map((auth) =>
auth.literal || `${auth.given} ${auth.family}`
? uniq(
structuredAuthors.map((auth) =>
auth.literal || `${auth.given} ${auth.family}`
),
)
: [];

Expand Down

0 comments on commit 478b3df

Please sign in to comment.