fix(route): show correct author name (AEON) (#14721)

This commit is contained in:
Enoch Ma 2024-03-08 16:35:33 +01:00 committed by GitHub
parent 21d6841a30
commit 1762692914
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -29,14 +29,14 @@ const getData = async (ctx, list) => {
// e.g. https://aeon.co/essays/how-to-mourn-a-forest-a-lesson-from-west-papua .
// But that's very rare.
item.author = data.props.pageProps.article.authors.map((author) => author.displayName).join(', ');
item.author = data.props.pageProps.article.authors.map((author) => author.name).join(', ');
const article = data.props.pageProps.article;
const capture = load(article.body);
const banner = article.thumbnail?.urls?.header;
capture('p.pullquote').remove();
const authorsBio = article.authors.map((author) => '<p>' + author.displayName + author.authorBio.replaceAll(/^<p>/g, ' ')).join('');
const authorsBio = article.authors.map((author) => '<p>' + author.name + author.authorBio.replaceAll(/^<p>/g, ' ')).join('');
item.description = art(path.join(__dirname, 'templates/essay.art'), { banner, authorsBio, content: capture.html() });
}