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

Support multiple authors / multiauthor #22

Closed
natrius opened this issue Jan 7, 2025 · 10 comments
Closed

Support multiple authors / multiauthor #22

natrius opened this issue Jan 7, 2025 · 10 comments

Comments

@natrius
Copy link

natrius commented Jan 7, 2025

I want to import from a blog where multiple authors have written posts and i also want to keep that information as well as keep it in future.
Ideally without external requisites. A simple field in frontmatter like author: someName could be enough already.

As an idea, this https://codingnconcepts.com/hugo/multiple-authors-hugo/ sounds nice, with authors that can be filled beforehand and a default for when the author is not provided.
https://moonbooth.com/hugo/authors/ this seems also to be an example, but its one year older.

This example kinda seems to work, but its 7 years old now, not sure if that should get more attention :D

@lrh11099
Copy link

lrh11099 commented Jan 7, 2025

@natrius see gohugoio/hugoDocs#2494 (comment). I would propose this approach of taxonomy if @mansoorbarri will accept that.

@mansoorbarri
Copy link
Owner

this can be a good feature if implemented correctly. I wouldn't go with the method @stoic-hugo mentioned as it would clutter the taxonomy.

For now, I want to focus on fixing the issues from the original theme and implementing PRs. However, I will add this in the roadmap.

@natrius
Copy link
Author

natrius commented Jan 8, 2025

It reads to me the version with taconomy in the link mentioned is the 'official' supported or recommended one. Or eventually will be. jmooring seems to be hugo dev and a big contributor in the documentation.

@mansoorbarri
Copy link
Owner

I am new to the taxonomy method suggested by him. I will need to learn more about it and then we can implement this feature.

As of now, this is in our roadmap.

@mansoorbarri
Copy link
Owner

i tried implementing the suggested method however, that only works for single pages. for example, you can have a page like /authors/{author_name} which would show a page with author's information. this will not change the authorbox which is currently being used.

my idea to implement multiple authors is that we use the author in config.toml for a global author which is also used in the opengraph tags. then we update authobox.html to allow multiple authors from the frontmatter of posts which can look something like this:

authors:
  - name: "Author One"
    avatar: "/favicon.svg"
    bio: "Author One is a seasoned writer with expertise in technology."
  - name: "Author Two"
    avatar: "/favicon.svg"
    bio: "Author Two is a creative thinker specializing in design."

generating this:

image

CC: @natrius @stoic-hugo

@natrius
Copy link
Author

natrius commented Jan 10, 2025

Have you downloaded the example from the github link mentioned in gohugoio/hugoDocs#2494 (comment) ?

Because i get some four posts and when opening a post the author is shown above with a link to the author like
image
or with multiple like
image

And i think thats perfectly fine? I mean, the "first site author" and "first page author" could be scrapped in my opinion, but besides that it looks nice? Clicking on "John Doe" opens the john doe site and links their publications and so on.

Inside the frontmatter its just authors = ['rsmith','jdoe','mjones'] and the information for jdoe is made in a page \content\authors\jdoe and contains

---
title: John Doe
date: 2024-03-19T17:35:59.000Z
draft: false
siteAuthor: true
params:
  name:
    first: John
    last: Doe
    prefix: Mr.
  contact:
    email: [email protected]
    phone: +1 202-555-1212
  social:
    - service: GitHub
      link: 'https://github.com/jdoe'
    - service: Facebook
      link: 'https://www.facebook.com/jdoe'
---

Mr. Doe is an accomplished something with hundreds of years of experience building widgets.

I think that sounds like an really good solutions and is easy expendable. I think the frontmatter in the page itself should probably expanded with "nickname" because i know some will just put there a nickname :D

@mansoorbarri
Copy link
Owner

mansoorbarri commented Jan 10, 2025

just a quick recap before I attempt to fix this:

  • we want the user to add all the author's information in content/authors/
  • we want to show the name of the author only in the authorbox

am I on the same page?

@natrius
Copy link
Author

natrius commented Jan 10, 2025

Thats at least why i think would be good for a multi-user-support. And if i click on the author-name i get information about the author and their articles.

Additionally could be, if a nickname or a username is set in frontmatter that does not exist in content/authors/ it could simply use exactly that set nickname/username. But i don't know if that should be a new ticket with expanding on that feature 🤷

@lrh11099
Copy link

I don't have any multi-author sites. So, I don't have any dog in this fight. I will leave this to you and others to choose the best way forward.

@mansoorbarri
Copy link
Owner

fixed in d669a98

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants