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 mutliple authors in one post #1341

Closed
ldt116 opened this issue Nov 10, 2017 · 10 comments

Comments

@ldt116
Copy link

commented Nov 10, 2017

Add ability to support multiple authors for one post. I think we can create a YAML Front Matter like in this post

authors:
- author1
- author2

And the list authors should be displayed on left column.

  • This is a question about using the theme.
  • This is a feature request.
  • I believe this to be a bug with the theme.
    • I have updated all gems with bundle update.
    • I have tested locally with bundle exec jekyll build.
@ldt116

This comment has been minimized.

Copy link
Author

commented Nov 13, 2017

Currently, I archive this by below work around code. I am new to Jekyll so that this snippet contains duplicated code. Hope you can make update.

https://raw.githubusercontent.com/ldt116/bkolp/master/docs/_includes/author-profile.html

@ldt116

This comment has been minimized.

Copy link
Author

commented Nov 13, 2017

I made a little improve the code for supporting multiple authors in single post by adding the following code in author-profile.html

{% assign authorCount = page.authors | size %}
{% if authorCount == 0 %}
  {% if page.author and site.data.authors[page.author] %}
    {% assign author = site.data.authors[page.author] %}
  {% else %}
    {% assign author = site.author %}
  {% endif %}
  
  {% assign authors = {{author.authorid | split: "," }} %}
{% else %}
  {% assign authors = page.authors %}
{% endif %}

<div itemscope itemtype="http://schema.org/Person">
  {% for authorid in authors %}
  <p>
...
  </p>
  {% endfor %}
</div>

But there is a little change that we need to add field authorid in _config.ymml to make the no author post automatically add the default site author.

@mmistakes

This comment has been minimized.

Copy link
Owner

commented Nov 13, 2017

I don't know that this is something 80% of the theme's users would need. In fact I can't recall ever seeing a blog post that listed multiple authors, which tells me it's a fairly niche request.

The best route is for you to customize the author profile as you've done above. But I don't think this is something I'd be interested in incorporating into the theme's core, especially due to the Liquid for loop and possible performance implications that would have.

@stale

This comment has been minimized.

Copy link

commented Dec 13, 2017

This issue has been automatically marked as stale because it has not had recent activity.

If this is a bug and you can still reproduce this error on the master branch, please reply with any additional information you have about it in order to keep the issue open.

If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.

This issue will automatically be closed in 7 days if no further activity occurs. Thank you for all your contributions.

@stale stale bot added the Status: Stale label Dec 13, 2017

@stale stale bot closed this Dec 20, 2017

@mmistakes mmistakes referenced this issue Jan 16, 2018
1 of 5 tasks complete

isugif pushed a commit to ISUgenomics/bioinformatics-workbook that referenced this issue May 1, 2019

@infominer33

This comment has been minimized.

Copy link

commented Jun 25, 2019

I don't know that this is something 80% of the theme's users would need. In fact I can't recall ever seeing a blog post that listed multiple authors, which tells me it's a fairly niche request.

The best route is for you to customize the author profile as you've done above. But I don't think this is something I'd be interested in incorporating into the theme's core, especially due to the Liquid for loop and possible performance implications that would have.

Would you have any suggestions on how to improve that script? I'm using MM for a few github organizations, and it would be nice to show who has contributed to a particular page...

I'd probably be better off using github metadata, but I'm no coder...

If you have any thoughts on the matter, I'd really appreciate your opinion.


note: I really love your work, and have been using your themes since a few months now... no other theme I've touched compares to minimal mistakes.. and it's incredible how you build hugo versions at the same time.. or idk how you do that really I guess you build both as a team together

@mmistakes

This comment has been minimized.

Copy link
Owner

commented Jun 25, 2019

@infominer33 You can assign a different author for a post and they will show up in sidebar instead of the site default. What the theme doesn’t support is assigning more than one author for a post, which is what this issue was requesting.

Check the sample posts and theme documentation for more info.

https://mmistakes.github.io/minimal-mistakes/layout-author-override/
https://mmistakes.github.io/minimal-mistakes/docs/authors/

@infominer33

This comment has been minimized.

Copy link

commented Jun 25, 2019

yes, that's what I meant.

Example:

Just hoping for your suggestion, I might use his script as is... but maybe you have a better idea I should explore

@mmistakes

This comment has been minimized.

Copy link
Owner

commented Jun 25, 2019

No really suggestions from me. The theme was designed to have a single author in the sidebar. Your best bet is ignoring the sidebar and just group the authors in the body in some sort of grid treatment. There’s no way they will all fit comfortable in a sidebar.

@infominer33

This comment has been minimized.

Copy link

commented Jun 25, 2019

oh yeah, I wasn't really thinking about the sidebar. Thanks for all your hard work and dedication! I'll figure out what I need from here.

@infominer33

This comment has been minimized.

Copy link

commented Jun 25, 2019

infominer33/infominer33.github.io@d80cae2

here is my solution for including authors at the bottom of each post just like tags and categories

which I pieced together by examining your code and this answer on stack overvlow

https://stackoverflow.com/questions/15189008/how-can-i-have-multiple-authors-for-one-post-in-jekyll

Note: I achieve links by using a full html link for each 'author' in the "authors" front matter, as is shown on only one of the files in that specific commit. Markdown links won't work.

I adjusted some other things in the surrounding commits, you'll want to see if you're trying to hack together a solution, like me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.