Skip to content

Commit b982b2c

Browse files
committed
multiple authors
1 parent 4c5f705 commit b982b2c

File tree

7 files changed

+26
-7
lines changed

7 files changed

+26
-7
lines changed

app/pages/learn/01_tutorial/01_your-first-java-app/01_getting-started-with-java.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ toc:
2424
- Going Further {going-further}
2525
description: "Downloading and setting up the JDK, writing your first Java class, and creating your first Java application."
2626
last_update: 2022-10-29
27-
author: ["JoséPaumard"]
27+
author: ["JoséPaumard", "ChadArimura"]
2828
---
2929

3030
<a id="first-app">&nbsp;</a>

app/templates/pages/learn/tutorial-group-top.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<h1>{{ file.fm.title_html | safe }}</h1>
2121

2222
{% if file.fm.author %}
23-
{% include "app/templates/partials/_author.html" %}
23+
{% include "app/templates/partials/_author_byline.html" %}
2424
{% endif %}
2525

2626
<p>{{ contents | safe }}</p>

app/templates/pages/learn/tutorial-group.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<h1>{{ file.fm.title_html | safe }}</h1>
3737

3838
{% if file.fm.author %}
39-
{% include "app/templates/partials/_author.html" %}
39+
{% include "app/templates/partials/_author_byline.html" %}
4040
{% endif %}
4141

4242
<div class="row">

app/templates/pages/learn/tutorial.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<h1>{{ file.fm.title_html | safe }}</h1>
2020

2121
{% if file.fm.author %}
22-
{% include "app/templates/partials/_author.html" %}
22+
{% include "app/templates/partials/_author_byline.html" %}
2323
{% endif %}
2424

2525
<div class="row">

app/templates/partials/_author.html

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
This page was contributed by
3+
4+
{% if file.fm.author | length > 0 %}
5+
{% for author in file.fm.author %}
6+
<a href="/author/{{ author }}">{{ file.data.authorsMap[author].name }}</a> {% if not loop.last %}and{% endif %}
7+
{% endfor %}
8+
{% else %}
9+
<a href="/author/{{ file.fm.author }}">{{ file.data.authorsMap[file.fm.author].name }}</a>
10+
{% endif %}
11+
12+
under the <a href="https://oss.oracle.com/licenses/upl/">UPL</a><br />
13+

gulpfile.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,15 @@ function pre_process_pages() {
163163

164164
.pipe(data(function (file) {
165165
if (file.fm.author) {
166-
authorsMap[file.fm.author].tutorials.push(file.fm.id);
166+
if (file.fm.author.length > 1) {
167+
console.log("Adding tutorial " + file.fm.id + " to multiple authors: " + file.fm.author);
168+
for (const author of file.fm.author) {
169+
authorsMap[author].tutorials.push(file.fm.id);
170+
}
171+
} else {
172+
console.log("Adding tutorial " + file.fm.id + " to single author: " + file.fm.author);
173+
authorsMap[file.fm.author].tutorials.push(file.fm.id);
174+
}
167175
}
168176
}))
169177
}

0 commit comments

Comments
 (0)