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.xml] Add rel and type to site link #2276

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8d16d17
Next version
Keats Mar 19, 2023
b00ae42
print error message when no config file found (#2168)
iEverX Apr 6, 2023
1ed722c
Speedup "zola check" command by reusing the Client (#2171)
MTRNord Apr 6, 2023
6a5c241
Implement replace_re filter (#2163)
cydave Apr 20, 2023
c48b61a
templates: add base URL for feed content (#2190)
jk-ozlabs Apr 23, 2023
7edf92b
Fix multi-lingual json index (#2197)
Jieiku Apr 28, 2023
7448309
Add search.index_format into the serialized config (#2165) (#2196)
Raymi306 May 1, 2023
4f77980
Fix typo in error message
Keats May 2, 2023
1321a83
Hard link serve panic fix (#2210)
Raymi306 May 6, 2023
b5a90db
Add support for lazy loading images (#2211)
sinofp May 6, 2023
1778707
Prevent spans crossing line boundaries in class-based code block form…
TheOnlyMrCat Jul 10, 2023
afc0e2c
always sort assets by filename (Windows/Linux difference) (#2236)
wold5 Jul 10, 2023
66f5bf5
Atom template authors (#2259)
heitorPB Jul 26, 2023
f962370
Add attributes to base_url link in atom template (#2261)
savq Jul 27, 2023
d3793cd
Fixes #2250; Error instead of panic when root directory or config fil…
Raymi306 Jul 30, 2023
fe1967f
Fix LFI in `zola serve` (#2258)
adeadfed Aug 4, 2023
b97a1d5
Update changelog
Keats Aug 4, 2023
f0b984d
Update edition
Keats Aug 4, 2023
57968be
Update deps
Keats Aug 4, 2023
c4341b1
Add ignored_static to config (#2209)
Raymi306 Aug 13, 2023
4474afa
template:feeds: add extra block (#2263)
heitorPB Aug 13, 2023
5f13e77
[atom.xml] Add rel and type to site link
ptxmac Aug 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Atom template authors (#2259)
* 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
  • Loading branch information
heitorPB authored Jul 26, 2023
commit 66f5bf5abdb08f8d87828723e1720e8e3c695fac
5 changes: 5 additions & 0 deletions components/site/tests/site.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
12 changes: 9 additions & 3 deletions components/templates/src/builtins/atom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,23 @@
<title>{{ page.title }}</title>
<published>{{ page.date | date(format="%+") }}</published>
<updated>{{ page.updated | default(value=page.date) | date(format="%+") }}</updated>
{% for author in page.authors %}
<author>
<name>
{%- if page.authors -%}
{{ page.authors[0] }}
{%- elif config.author -%}
{{ author }}
</name>
</author>
{% else %}
<author>
<name>
{%- if config.author -%}
{{ config.author }}
{%- else -%}
Unknown
{%- endif -%}
</name>
</author>
{% endfor %}
<link rel="alternate" href="{{ page.permalink | safe }}" type="text/html"/>
<id>{{ page.permalink | safe }}</id>
{% if page.summary %}
Expand Down
1 change: 1 addition & 0 deletions test_site/content/posts/tutorials/programming/rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title = "Rust"
weight = 2
date = 2017-01-01
authors = ["Foo Doe", "Bar Doe", "Baz Doe"]
+++

A simple page
Expand Down