Fix blog post authors
Jim committed
Oct 14, 2015 at 17:32 UTC
5ae4f035c70f4debeeb87307edaad0beda0627b2
6 files changed
+35
-13
docs/_data/authors.yml
+6
-4
@@ -1,8 +1,6 @@
1
# Map of short name to more information. `name` will be used but if you don't
2
# want to use your real name, just use whatever. If url is included, your name
3
# will be a link to the provided url.
4
-billandjing:
5
- name: Bill Fisher and Jing Chen
4
chenglou:
5
name: Cheng Lou
6
url: https://twitter.com/_chenglou
@@ -18,8 +16,12 @@ jaredly:
16
jgebhardt:
17
name: Jonas Gebhardt
18
url: https://twitter.com/jonasgebhardt
21
-jimandsebastian:
22
- name: Jim Sproch and Sebastian Markbåge
19
+jimfb:
20
+ name: Jim Sproch
21
+ url: http://www.jimsproch.com
22
+jingc:
23
+ name: Jing Chen
24
+ url: https://twitter.com/jingc
25
josephsavona:
26
name: Joseph Savona
27
url: https://twitter.com/en_JS
docs/_includes/blog_post.html
+8
-5
@@ -11,11 +11,14 @@
11
<p class="meta">
12
{{ page.date | date: "%B %e, %Y" }}
13
by
14
- {% if page.author.url %}
15
- <a href="{{page.author.url}}">{{ page.author.name }}</a>
16
- {% else %}
17
- {{ page.author.name }}
18
- {% endif %}
14
+ {% for author in page.authors %}
15
+ {% if author.url %}
16
+ <a href="{{author.url}}">{{ author.name }}</a>
17
+ {% else %}
18
+ {{ author.name }}
19
+ {% endif %}
20
+ {% if forloop.last == false %} and {% endif %}
21
+ {% endfor %}
22
</p>
23
24
<hr>
docs/_plugins/authors.rb
+9
-1
@@ -7,7 +7,15 @@ module Authors
7
class Generator < Jekyll::Generator
8
def generate(site)
9
site.posts.each do |post|
10
- post.data['author'] = site.data['authors'][post['author']]
10
+ authors = []
11
+ if post['author'].kind_of?(Array)
12
+ for author in post['author']
13
+ authors.push(site.data['authors'][author])
14
+ end
15
+ else
16
+ authors.push(site.data['authors'][post['author']])
17
+ end
18
+ post.data['authors'] = authors
19
end
20
end
21
end
docs/_posts/2014-05-06-flux.md
+1
-1
@@ -1,6 +1,6 @@
1
---
2
title: "Flux: An Application Architecture for React"
3
-author: fisherwebdevandjing
3
+author: [fisherwebdev, jingc]
4
---
5
6
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:
docs/_posts/2015-10-01-react-render-and-top-level-api.md
+1
-1
@@ -1,6 +1,6 @@
1
---
2
title: "ReactDOM.render and the Top Level React API"
3
-author: jimandsebastian
3
+author: ["jimfb", "sebmarkbage"]
4
---
5
6
docs/blog/all.html
+10
-1
@@ -9,7 +9,16 @@ id: all-posts
9
<div class="inner-content">
10
<h1>All Posts</h1>
11
{% for page in site.posts %}
12
- <p><strong><a href="/react{{ page.url }}">{{ page.title }}</a></strong> on {{ page.date | date: "%B %e, %Y" }} by {{ page.author.name }}</p>
12
+ <p><strong><a href="/react{{ page.url }}">{{ page.title }}</a></strong> on {{ page.date | date: "%B %e, %Y" }} by
13
+ {% for author in page.authors %}
14
+ {% if author.url %}
15
+ <a href="{{author.url}}">{{ author.name }}</a>
16
+ {% else %}
17
+ {{ author.name }}
18
+ {% endif %}
19
+ {% if forloop.last == false %} and {% endif %}
20
+ {% endfor %}
21
+ </p>
22
{% endfor %}
23
</div>
24
</section>