diff --git a/components/site/tests/site.rs b/components/site/tests/site.rs index 2c6d3c46bb..baca868e2b 100644 --- a/components/site/tests/site.rs +++ b/components/site/tests/site.rs @@ -680,6 +680,11 @@ fn can_build_feeds() { assert!(file_contains!(public, "posts/tutorials/programming/atom.xml", "Rust")); // It doesn't contain articles from other sections assert!(!file_contains!(public, "posts/tutorials/programming/atom.xml", "Extra Syntax")); + + // Test Atom feed entry with 3 authors + assert!(file_contains!(public, "posts/tutorials/programming/atom.xml", "Foo Doe")); + assert!(file_contains!(public, "posts/tutorials/programming/atom.xml", "Bar Doe")); + assert!(file_contains!(public, "posts/tutorials/programming/atom.xml", "Baz Doe")); } #[test] diff --git a/components/templates/src/builtins/atom.xml b/components/templates/src/builtins/atom.xml index 2f16095563..4d8b3ec6e7 100644 --- a/components/templates/src/builtins/atom.xml +++ b/components/templates/src/builtins/atom.xml @@ -24,17 +24,23 @@ {{ page.title }} {{ page.date | date(format="%+") }} {{ page.updated | default(value=page.date) | date(format="%+") }} + {% for author in page.authors %} - {%- if page.authors -%} - {{ page.authors[0] }} - {%- elif config.author -%} + {{ author }} + + + {% else %} + + + {%- if config.author -%} {{ config.author }} {%- else -%} Unknown {%- endif -%} + {% endfor %} {{ page.permalink | safe }} {% if page.summary %} diff --git a/test_site/content/posts/tutorials/programming/rust.md b/test_site/content/posts/tutorials/programming/rust.md index e9986e12ea..6a7d8081e7 100644 --- a/test_site/content/posts/tutorials/programming/rust.md +++ b/test_site/content/posts/tutorials/programming/rust.md @@ -2,6 +2,7 @@ title = "Rust" weight = 2 date = 2017-01-01 +authors = ["Foo Doe", "Bar Doe", "Baz Doe"] +++ A simple page