Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blog: author profile list file #5363

Closed
Josh-Cena opened this issue Aug 15, 2021 · 7 comments · Fixed by #5396
Closed

Blog: author profile list file #5363

Josh-Cena opened this issue Aug 15, 2021 · 7 comments · Fixed by #5396
Labels
feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.

Comments

@Josh-Cena
Copy link
Collaborator

Josh-Cena commented Aug 15, 2021

🚀 Feature

A separate author profile list file to prevent duplicating author information in every markdown front matter.

Have you read the Contributing Guidelines on issues?

Yes

Has this been requested on Canny?

Actually yes. https://docusaurus.io/feedback/p/add-unified-authors-data-file-to-reduce-header-attributes-for-blog-posts

Motivation

I am building an org blog where three authors take turns to write posts. Maintaining three sets of author information is a pain, especially when their avatars/description changes. Having a separated data file will make this much easier.

From the canny request:

In Jekyll, there's a authors.yml file that stores all authors' profile which includes social media links, author title and avatar url, so that we could just put only author attribute in blog header without author_title, author_url, author_image_url... in every post.

API Design

The Jekyll design, just for reference. We can have a /blog/data/authors.yml (JSON can work as well, of course), in which we put all the authors:

- Author 1:
    name: ...
    url: ...
    image_url: ....
    title: ...
- Author 2:
    name: ...
    url: ...
    image_url: ....
    title: ...

And then use them with a new author_key: Author 1 front matter in a blog post. User can still override those values in authors.yml within the post's front matter for more granular control.

Have you tried building it?

Not yet, would be willing to work on it

@Josh-Cena Josh-Cena added feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. status: needs triage This issue has not been triaged by maintainers labels Aug 15, 2021
@slorber
Copy link
Collaborator

slorber commented Aug 17, 2021

Yes we should definitively support that, as long as we can stay retrocompatible with existing frontmatter.

My blog Gatsby theme (Novela) also has such feature: https://github.com/slorber/sebastienlorber.com/tree/master/content/authors

@shakyapeiris
Copy link

shakyapeiris commented Aug 19, 2021

That means we need only to store that data in a json/yml file right?

@Josh-Cena
Copy link
Collaborator Author

@shakyapeiris Yes, although you can't be exempted from front matter entirely though because you have to use an author_key front matter to reference that external data

@shakyapeiris
Copy link

Ok Thanks

@slorber
Copy link
Collaborator

slorber commented Aug 20, 2021

We also have a need for blog posts with multiple authors.

#4527

So we'd likely use a frontmatter like author_ids: [author1, author2] to support that.

Not sure it's worth supporting multiple authors with existing frontmatter attributes. It would probably require a breaking change so that the existing frontmatter can support the list, so we may do this but later.

Note: author image URL can use a co-located asset in the folder's blog post now. Not sure we need this feature for "global blog authors" though

@Josh-Cena
Copy link
Collaborator Author

Note: author image URL can use a co-located asset in the folder's blog post now. Not sure we need this feature for "global blog authors" though

I tried a very rough implementation and I noticed it's hard to co-locate assets in the global file. I guess we can only support using URLs to reference images in global files, but allow overriding this with a collocated image in front matter?

We can certainly make author_key accept multiple IDs

@Josh-Cena
Copy link
Collaborator Author

There has also been requests for author pages:

After we have unique author keys this feature may be easier to implement?

@Josh-Cena Josh-Cena removed the status: needs triage This issue has not been triaged by maintainers label Feb 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants