Skip to content

Blog authors page bugs for authors with 0 posts #10427

@slorber

Description

@slorber

Description

This page doesn't look good: https://docusaurus.io/tests/blog/authors

CleanShot 2024-08-20 at 12 19 14

There's a "0" being appended to the author's name when they haven't written anything yet. This has been noticed while upgrading the React Native website:

image


Also, we should probably keep alignment for authors with/without images otherwise it looks messy.

What about generating empty grey placeholders for authors that have no image?

I think we could use the initials + a randomly-generated gradient.

I'd like to avoid relying on an external service, but we can take inspiration from https://github.com/vercel/avatar to build a CSS-only solution? (see https://github.com/vercel/avatar/blob/master/utils/gradient.ts)


The author page in this case should also display something more meaningful than this, probably a message telling us the author has not written anything yet, without separator?

CleanShot 2024-08-20 at 12 24 17

Metadata

Metadata

Assignees

Labels

bugAn error in the Docusaurus core causing instability or issues with its execution

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions