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

Fix blog post authors #5178

Merged
merged 1 commit into from
Oct 15, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 6 additions & 4 deletions docs/_data/authors.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Map of short name to more information. `name` will be used but if you don't
# want to use your real name, just use whatever. If url is included, your name
# will be a link to the provided url.
billandjing:
name: Bill Fisher and Jing Chen
chenglou:
name: Cheng Lou
url: https://twitter.com/_chenglou
Expand All @@ -18,8 +16,12 @@ jaredly:
jgebhardt:
name: Jonas Gebhardt
url: https://twitter.com/jonasgebhardt
jimandsebastian:
name: Jim Sproch and Sebastian Markbåge
jimfb:
name: Jim Sproch
url: http://www.jimsproch.com
jingc:
name: Jing Chen
url: https://twitter.com/jingc
josephsavona:
name: Joseph Savona
url: https://twitter.com/en_JS
Expand Down
13 changes: 8 additions & 5 deletions docs/_includes/blog_post.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@ <h1>
<p class="meta">
{{ page.date | date: "%B %e, %Y" }}
by
{% if page.author.url %}
<a href="{{page.author.url}}">{{ page.author.name }}</a>
{% else %}
{{ page.author.name }}
{% endif %}
{% for author in page.authors %}
{% if author.url %}
<a href="{{author.url}}">{{ author.name }}</a>
{% else %}
{{ author.name }}
{% endif %}
{% if forloop.last == false %} and {% endif %}
{% endfor %}
</p>

<hr>
Expand Down
10 changes: 9 additions & 1 deletion docs/_plugins/authors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ module Authors
class Generator < Jekyll::Generator
def generate(site)
site.posts.each do |post|
post.data['author'] = site.data['authors'][post['author']]
authors = []
if post['author'].kind_of?(Array)
for author in post['author']
authors.push(site.data['authors'][author])
end
else
authors.push(site.data['authors'][post['author']])
end
post.data['authors'] = authors
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion docs/_posts/2014-05-06-flux.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Flux: An Application Architecture for React"
author: fisherwebdevandjing
author: [fisherwebdev, jingc]
---

We recently spoke at one of f8's breakout session about Flux, a data flow architecture that works well with React. Check out the video here:
Expand Down
2 changes: 1 addition & 1 deletion docs/_posts/2015-10-01-react-render-and-top-level-api.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "ReactDOM.render and the Top Level React API"
author: jimandsebastian
author: ["jimfb", "sebmarkbage"]
---


Expand Down
11 changes: 10 additions & 1 deletion docs/blog/all.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,16 @@
<div class="inner-content">
<h1>All Posts</h1>
{% for page in site.posts %}
<p><strong><a href="/react{{ page.url }}">{{ page.title }}</a></strong> on {{ page.date | date: "%B %e, %Y" }} by {{ page.author.name }}</p>
<p><strong><a href="/react{{ page.url }}">{{ page.title }}</a></strong> on {{ page.date | date: "%B %e, %Y" }} by
{% for author in page.authors %}
{% if author.url %}
<a href="{{author.url}}">{{ author.name }}</a>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this shouldn't have become a link. I'll fix that.
Edit: done - e12ee95

{% else %}
{{ author.name }}
{% endif %}
{% if forloop.last == false %} and {% endif %}
{% endfor %}
</p>
{% endfor %}
</div>
</section>