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

"Prototype" pages feature for paginated archives of categories, tags, and other front matter values #11

Merged
merged 3 commits into from
Apr 21, 2020

Conversation

jaredcwhite
Copy link
Member

It's pretty late (even for me these days!) so I'll write up a better description in the morning. Essentially, you can do this:

_posts/2020-04-10-article-by-jared.md

---
title: I'm an article
author: jared
---

Content goes here.

_data/authors.yml

jared:
  name: Jared White
  twitter: jaredcwhite

authors/author.html

---
layout: default
title: Articles by :prototype-data-label
prototype:
  term: author
  data: authors
  data_label: name
---

<h1>{{ page.title }}</h1> <-- Articles by Jared White -->

<h2>Twitter: @{{ page.author_data.twitter }}</h2> <!-- Twitter: @jaredcwhite -->

<!-- posts where author == jared -->
{% for post in paginator.documents %}
  {% include post.html %}
{% endfor %}

@jaredcwhite jaredcwhite added the enhancement New feature or request label Apr 21, 2020
@jaredcwhite
Copy link
Member Author

P. S. Needs some feature tests.

@jaredcwhite
Copy link
Member Author

LGTM 👍

@jaredcwhite jaredcwhite merged commit c3519ce into master Apr 21, 2020
@jaredcwhite jaredcwhite deleted the prototype-pages branch May 1, 2020 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant