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

Atom template authors #2259

Merged
merged 2 commits into from
Jul 26, 2023
Merged

Atom template authors #2259

merged 2 commits into from
Jul 26, 2023

Conversation

heitorPB
Copy link
Contributor

IMPORTANT: Please do not create a Pull Request adding a new feature without discussing it first.

The place to discuss new features is the forum: https://zola.discourse.group/
If you want to add a new feature, please open a thread there first in the feature requests section.

Sanity check:

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

Code changes

(Delete or ignore this section for documentation changes)

  • Are you doing the PR on the next branch?

If the change is a new feature or adding to/changing an existing one:

  • Have you created/updated the relevant documentation page(s)?

Atom 1.0 [0] support multiple <author> entries in the feed. This commit modified the template to generate as many <author> as the page's metadata contains.

Forum post: https://zola.discourse.group/t/why-the-default-feed-templates-only-use-the-first-author/1738

[0] https://validator.w3.org/feed/docs/atom.html#recommendedEntryElements

@heitorPB
Copy link
Contributor Author

Ouch, I started the code from the master branch, will rebase on top of next.

Atom 1.0 [0] support multiple `<author>` entries in the feed. This commit
modified the template to generate as many `<author>` as the page's
metadata contains.

[0] https://validator.w3.org/feed/docs/atom.html#recommendedEntryElements
@heitorPB heitorPB force-pushed the atom-template-authors branch from 7f5351c to db9cd54 Compare July 25, 2023 13:59
@Keats
Copy link
Collaborator

Keats commented Jul 25, 2023

Can you add some tests?

@heitorPB
Copy link
Contributor Author

I can :)
Could you guide me on where is the most appropriate place for that?

@Keats
Copy link
Collaborator

Keats commented Jul 25, 2023

This file https://github.com/getzola/zola/blob/master/components/site/tests/site.rs is a giant integration test loading this site https://github.com/getzola/zola/tree/master/test_site
In one of the existing pages, add multiple authors and check that the authors are present in the atom file

@heitorPB heitorPB force-pushed the atom-template-authors branch from 48b6acf to e3f677a Compare July 25, 2023 21:59
@heitorPB
Copy link
Contributor Author

Thanks!

That's a very neat test suite.

I extended the Rust post to have 3 authors, here's its Atom section:

    <entry xml:lang="en">
        <title>Rust</title>
        <published>2017-01-01T00:00:00+00:00</published>
        <updated>2017-01-01T00:00:00+00:00</updated>

        <author>
          <name>
            Foo Doe
          </name>
        </author>

        <author>
          <name>
            Bar Doe
          </name>
        </author>

        <author>
          <name>
            Baz Doe
          </name>
        </author>

        <link rel="alternate" href="https://replace-this-with-your-url.com/posts/tutorials/programming/rust/" type="text/html"/>
        <id>https://replace-this-with-your-url.com/posts/tutorials/programming/rust/</id>

        <summary type="html">&lt;p&gt;A simple page&lt;&#x2F;p&gt;
</summary>

    </entry>

@heitorPB heitorPB force-pushed the atom-template-authors branch from e3f677a to 805bbb5 Compare July 25, 2023 22:07
@heitorPB
Copy link
Contributor Author

@Keats do you think I should add anything to the documentation? For example, what gets added to the atom/rss feed?

Copy link
Collaborator

@Keats Keats left a comment

Choose a reason for hiding this comment

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

Neat, thanks!

@Keats Keats merged commit 66f5bf5 into getzola:next Jul 26, 2023
peterprototypes pushed a commit to peterprototypes/zola that referenced this pull request Sep 12, 2023
* templates:atom: add support for multiple authors

Atom 1.0 [0] support multiple `<author>` entries in the feed. This commit
modified the template to generate as many `<author>` as the page's
metadata contains.

[0] https://validator.w3.org/feed/docs/atom.html#recommendedEntryElements

* Test we can have multiple authors in ATOM feeds
technimad pushed a commit to technimad/zola that referenced this pull request Sep 30, 2023
* templates:atom: add support for multiple authors

Atom 1.0 [0] support multiple `<author>` entries in the feed. This commit
modified the template to generate as many `<author>` as the page's
metadata contains.

[0] https://validator.w3.org/feed/docs/atom.html#recommendedEntryElements

* Test we can have multiple authors in ATOM feeds
Keats pushed a commit that referenced this pull request Dec 18, 2023
* templates:atom: add support for multiple authors

Atom 1.0 [0] support multiple `<author>` entries in the feed. This commit
modified the template to generate as many `<author>` as the page's
metadata contains.

[0] https://validator.w3.org/feed/docs/atom.html#recommendedEntryElements

* Test we can have multiple authors in ATOM feeds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants