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

Jekyll author pages support #1919

Closed
MartinThoma opened this issue Jan 6, 2014 · 20 comments
Closed

Jekyll author pages support #1919

MartinThoma opened this issue Jan 6, 2014 · 20 comments

Comments

@MartinThoma
Copy link

I would like to have author pages.

On the file system (in the Jekyll root folder with all the source files) I would like to use

_authors/martin-thoma.md
_authors/john-smith.md
_authors/mary-johnson.html

On the file system (in the generated _sites folder) I would like to get

author/martin-thoma/index.html
author/john-smith/index.html
author/mary-johnson/index.html

Also, it would be nice to be able to access the posts generated by the author in a paginated way:

<h2>Posts by {% author %}</h2>
{% for post in authorpaginator.posts %}
    <div class="post type-post hentry clearfix">
        <h2 class="title"><a href="{{ site.baseurl }}{{ post.url }}/" rel="bookmark" title="Permanent link to '{{ post.title }}'">{{ post.title }}</a></h2>
        <div class="postdate">
            <span>{{ post.date | date: '%B' }} {{ post.date | date: '%e' }}, {{ post.date | date: '%Y' }}</span> 
            <!--<span>No Comments / 1 comment / 2 comments</span>-->
        </div>

        {% include entry.html %}
    </div>
{% endfor %}
  • Is something like this currently possible with Jekyll?
  • Are there example pages (blogs)? If so, where are they?
@doktorbro
Copy link
Member

The author is just another taxonomy, like tag or category. You can manually create the index page:

<!-- /source/author/martin-thoma/index.html -->
---
author: thoma
layout: author
---

and the corresponding layout:

<!-- /source/_layouts/author.html -->

<!-- place the loop over author’s posts here -->

The where filter available soon will help you to loop. The pagination is not possible here.

@mhulse
Copy link

mhulse commented Jan 7, 2014

@penibelst, could you re-post that link to the where filter? Sounds interesting.

@doktorbro
Copy link
Member

@mhulse Thanks, I fixed the link to #1875

@MartinThoma
Copy link
Author

Could I use where like this:

{% for post in (site.posts | where:"author","martin" )  %}

?

@mhulse
Copy link

mhulse commented Jan 7, 2014

@penibelst Looks like a useful filter, thanks! 👍

@doktorbro
Copy link
Member

Could I use where like this:

I’m not sure. I think you need one more step:

{% assign author = site.posts | where: "author", "martin" %}
{% for post in author %}
...
{% endfor %}

@benbalter: right?

@benbalter
Copy link
Contributor

Looks right to me.

@MartinThoma
Copy link
Author

@penibelst @benbalter Thanks guys. I'm looking forward to the next jekyll version with where to try it :-)
@penibelst I've figured the author/martin-thoma/index.md solution out today, but I've still hoped there was a way to do it "directly". Well, it's probably better how it is. In fact it really doesn't matter, I just have to get used to the way jekyll works. Now I could remove the author plugin :-)

@doktorbro
Copy link
Member

@MartinThoma A migration from Wordpress could be a chance to learn what really matters. All the category, tag, author, year, month and day archives are not really helpful for readers. Geeks do it because they can.

@mhulse
Copy link

mhulse commented Jan 7, 2014

@penibelst

All the category, tag, author, year, month and day archives are not really helpful for readers. Geeks do it because they can.

Devil's advocate:

I guess it's a matter of perspective. For example, I'm building my navigation based on categories; when category clicked, the posts filter based on that category with pagination.

As for tags, it's nice to use tags more liberally than cats, but allow them to behave in same way (i.e., click tag and go to posts filtered based on tag).

I think being able to find content based on category, tag, author, year, month and day is maybe more helpful to some people than you might think it is.

Not only that, but being able to syndicate based on tag/category is pretty nice too.

Though, maybe you're right ... Maybe only geeks find that useful. I guess it all depends on who your target audience is.

Full disclosure, in terms of blogs/cms', I'm coming from an Expression Engine, WordPress, Textpattern and Django background. I was going to use WP until I discovered Jekyll a few weeks back.

@doktorbro
Copy link
Member

@mhulse You know how to code. Nice for you. But do you know how to tell stories? This is what people care about. Not stupid listings called Tags and another one Categories. Read the latest article by Mark Boulton The story is the link.

@mhulse
Copy link

mhulse commented Jan 7, 2014

@penibelst, I'm just saying it's nice to filter content based on tags/categories/author/other.

It's funny you link to an article that references newsrooms/journalism. I actually work at the second largest newspaper in Oregon as a web developer. 😄

Me personally, I'm trying to build a portfolio site, so the content will be more visual than text. And no, I'm not a story teller. My goal is to have the ability to click a category, tag or date, and have posts show based on that content. If I had multiple authors, I'd want the ability to click on an author name to view all posts by said author (pagination is a must). IMHO, that's pretty basic blog functionality.

Anyway, I'll take the time to read that article in more detail later today. Thanks for link. 👍

Have a nice day!

@MartinThoma
Copy link
Author

@penibelst Tags really matter to me. As @mhulse already pointed out, they are really great to explore the site. When I find a new blog with an interesting article, I look for more articles in the same domain.
And for most blogs I read, I really don't care about stories. I like reading about algorithms, LaTeX and mathematics. For most articles, my target audience are computer science students from Karlsruhe (Germany). When they read my articles, they are preparing for exams and try to find material for that. I don't think they look for stories, either.

However, I thought about dropping categories. Although they are semantically different, they seem not to add so much value to the reader. But that should not matter for the site generator. Jekyll should not dictate what elements I use in my site / how I structure it.

@doktorbro
Copy link
Member

@mhulse, @MartinThoma WIth stories I mean user guidance in general. You can represent every kind of information in a narrative way. This is what preachers and teachers do, they tell stories.

When I find a new blog with an interesting article, I look for more articles in the same domain.

Me too. Everybody does. The question is, how to show the reader what is in the same domain. A tag is a necessary tool, but you don’t need to expose the tag itself to the reader. Jakob Nielsen lists the tag overuse in Top 10 Information Architecture Mistakes:

Rather than spend time upfront to develop several intuitive and logical top-level categories, teams rush through this important process, creating numerous weak categories and listing products multiple times within them. The usability impact? Users spend too much time agonizing over top-level categories and then get confused when they see items showing up in multiple places ("are these the same thing?").

With too many classification options and too many structured dimensions, users are forced to think harder to move forward. The profusion of options also makes people question the information scent. This lack of confidence early in the site experience extends throughout their visit and can negatively impact the end result (by thwarting a purchase, for example).

A short list of related articles after the main article — built on the tag or handcrafted — combined with a different color for visited links will make you a better host. Your visitors will love your pleasing manner.

@mhulse
Copy link

mhulse commented Jan 8, 2014

@penibelst, I understand what you mean now. Thanks for clarification!

Thanks for link to Jakob Nielsen article as well. I actually just signed up for their newsletter a few weeks back. Love it!

http://www.nngroup.com/articles/subscribe/

One of my favorite newsletters.

@parkr
Copy link
Member

parkr commented Jan 22, 2014

This will be possible with Collections! Closing.

@parkr parkr closed this as completed Jan 22, 2014
@xavibenjamin
Copy link

xavibenjamin commented Sep 14, 2016

I'm also trying to do something like this. This is what I have in my layout and it doesn't work:

{% assign author = site.posts | where: "author", "{{  page.author }}" %}
{% for post in author %}
…
{% endfor %}

It seems assign doesn't let me assign it something dynamic like {{ page.author }}.

My template looks like this:

# src/author/timsmith/index.md

---
layout: author-archive
author: timsmith
---

@pathawks
Copy link
Member

@smithtimmytim Your question is unrelated to this issue. You should open a new issue for your question:+1:

@xavibenjamin
Copy link

Well… it's kind of related, but ok 😄

@BlkPingu
Copy link

BlkPingu commented Aug 9, 2018

This will be possible with Collections! Closing.

Can you elaborate? @parkr
I'm also trying to paginate by author. Posted on SO about it.
https://stackoverflow.com/questions/51744240/how-to-paginate-posts-by-author

@jekyll jekyll locked and limited conversation to collaborators Aug 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants