Show all posts by author

I am using minimall-mistake jekyll theme.

I want the page of post where the it is sorted by author.

This is my code here

# _config.yml
collections:
  authors:
    output: true
    permalink: /posts/authors/:name

defaults:
# _author
  - scope:
      path: "_authors"
      type: authors
    values:
      layout: author-single
      author_profile: true
      suggestedcitiation: true

/_layouts/author-single.html

---
layout: archive
---

{% assign author_posts = site.posts | where:"author","page.author" %}
{% for post in author_posts %}
<div class="list__item">
	<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
		<h2 class="archive__item-title no_toc" itemprop="headline">
			<a href="{{ post.url | relative_url }}" rel="permalink">{{ post.title }}</a>
		</h2>
		{% include page__meta.html type=entries_layout %}
		{% if post.excerpt %}<p class="archive__item-excerpt" itemprop="description">
			{{ post.excerpt | markdownify | strip_html | truncate: 160 }}
		</p>{% endif %}
	</article>
</div>
{% endfor %}

My current output is listing all the posts.

Thanks

Hi,

I suspect that "page.author" shouldn’t be quoted.

{% assign author_posts = site.posts | where: "author", page.author %}
1 Like
---
layout: archive
---
{% for post in site.posts %}
{% if post.author contains page.username or page.username == post.author %}
<div class="list__item">
	<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork">
		<h2 class="archive__item-title no_toc" itemprop="headline">
			<a href="{{ post.url | relative_url }}" rel="permalink">{{ post.title }}</a>
		</h2>
		{% include page__meta.html type=entries_layout %}
		{% if post.excerpt %}<p class="archive__item-excerpt" itemprop="description">
			{{ post.excerpt | markdownify | strip_html | truncate: 160 }}
		</p>{% endif %}
	</article>
</div>
{% endif %}
{% endfor %}

This worked for me. ThanksPreformatted text