diff --git a/app/pages/learn/01_tutorial/01_your-first-java-app/01_getting-started-with-java.md b/app/pages/learn/01_tutorial/01_your-first-java-app/01_getting-started-with-java.md index e0c1c3d..cb2b6da 100644 --- a/app/pages/learn/01_tutorial/01_your-first-java-app/01_getting-started-with-java.md +++ b/app/pages/learn/01_tutorial/01_your-first-java-app/01_getting-started-with-java.md @@ -24,7 +24,7 @@ toc: - Going Further {going-further} description: "Downloading and setting up the JDK, writing your first Java class, and creating your first Java application." last_update: 2022-10-29 -author: ["JoséPaumard"] +author: ["JoséPaumard", "ChadArimura"] ---   diff --git a/app/templates/pages/learn/tutorial-group-top.html b/app/templates/pages/learn/tutorial-group-top.html index b8e9faf..4f98a79 100644 --- a/app/templates/pages/learn/tutorial-group-top.html +++ b/app/templates/pages/learn/tutorial-group-top.html @@ -20,7 +20,7 @@

{{ file.fm.title_html | safe }}

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

{{ contents | safe }}

diff --git a/app/templates/pages/learn/tutorial-group.html b/app/templates/pages/learn/tutorial-group.html index 1cddb57..c93971b 100644 --- a/app/templates/pages/learn/tutorial-group.html +++ b/app/templates/pages/learn/tutorial-group.html @@ -36,7 +36,7 @@

{{ file.fm.title_html | safe }}

{% if file.fm.author %} - {% include "app/templates/partials/_author.html" %} + {% include "app/templates/partials/_author_byline.html" %} {% endif %}
diff --git a/app/templates/pages/learn/tutorial.html b/app/templates/pages/learn/tutorial.html index 38f3dcf..0deb60d 100644 --- a/app/templates/pages/learn/tutorial.html +++ b/app/templates/pages/learn/tutorial.html @@ -19,7 +19,7 @@

{{ file.fm.title_html | safe }}

{% if file.fm.author %} - {% include "app/templates/partials/_author.html" %} + {% include "app/templates/partials/_author_byline.html" %} {% endif %}
diff --git a/app/templates/partials/_author.html b/app/templates/partials/_author.html deleted file mode 100644 index c47ad98..0000000 --- a/app/templates/partials/_author.html +++ /dev/null @@ -1,2 +0,0 @@ -This page was contributed by {{ file.data.authorsMap[file.fm.author].name }} under the UPL -
\ No newline at end of file diff --git a/app/templates/partials/_author_byline.html b/app/templates/partials/_author_byline.html new file mode 100644 index 0000000..725fcdb --- /dev/null +++ b/app/templates/partials/_author_byline.html @@ -0,0 +1,13 @@ + +This page was contributed by + +{% if file.fm.author | length > 0 %} + {% for author in file.fm.author %} + {{ file.data.authorsMap[author].name }} {% if not loop.last %}and{% endif %} + {% endfor %} +{% else %} + {{ file.data.authorsMap[file.fm.author].name }} +{% endif %} + +under the UPL
+ diff --git a/gulpfile.js b/gulpfile.js index 9201bf8..aa5a532 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -163,7 +163,15 @@ function pre_process_pages() { .pipe(data(function (file) { if (file.fm.author) { - authorsMap[file.fm.author].tutorials.push(file.fm.id); + if (file.fm.author.length > 1) { + console.log("Adding tutorial " + file.fm.id + " to multiple authors: " + file.fm.author); + for (const author of file.fm.author) { + authorsMap[author].tutorials.push(file.fm.id); + } + } else { + console.log("Adding tutorial " + file.fm.id + " to single author: " + file.fm.author); + authorsMap[file.fm.author].tutorials.push(file.fm.id); + } } })) }