-
Notifications
You must be signed in to change notification settings - Fork 990
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
The W3C feed validator fails to validate RSS 2.0 and Atom 1.0 feed elements that do not contain a valid author. This change adds an `authors: Vec<String>` to pages, as well as an `author: Option<String>` to Config that will act as a default to use in RSS and Atom templates if no page-level authors are specified.
- Loading branch information
Showing
10 changed files
with
165 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,43 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ lang }}"> | ||
<title>{{ config.title }} | ||
{%- if term %} - {{ term.name }} | ||
<title>{{ config.title }} | ||
{%- if term %} - {{ term.name }} | ||
{%- elif section.title %} - {{ section.title }} | ||
{%- endif -%} | ||
</title> | ||
{%- if config.description %} | ||
<subtitle>{{ config.description }}</subtitle> | ||
{%- endif %} | ||
<link href="{{ feed_url | safe }}" rel="self" type="application/atom+xml"/> | ||
<link href=" | ||
{%- endif -%} | ||
</title> | ||
{%- if config.description %} | ||
<subtitle>{{ config.description }}</subtitle> | ||
{%- endif %} | ||
<link href="{{ feed_url | safe }}" rel="self" type="application/atom+xml"/> | ||
<link href=" | ||
{%- if section -%} | ||
{{ section.permalink | escape_xml | safe }} | ||
{%- else -%} | ||
{{ config.base_url | escape_xml | safe }} | ||
{%- endif -%} | ||
"/> | ||
<generator uri="https://www.getzola.org/">Zola</generator> | ||
<updated>{{ last_updated | date(format="%+") }}</updated> | ||
<id>{{ feed_url | safe }}</id> | ||
{%- for page in pages %} | ||
<entry xml:lang="{{ page.lang }}"> | ||
<title>{{ page.title }}</title> | ||
<published>{{ page.date | date(format="%+") }}</published> | ||
<updated>{{ page.updated | default(value=page.date) | date(format="%+") }}</updated> | ||
<link rel="alternate" href="{{ page.permalink | safe }}" type="text/html"/> | ||
<id>{{ page.permalink | safe }}</id> | ||
<content type="html">{{ page.content }}</content> | ||
</entry> | ||
{%- endfor %} | ||
<generator uri="https://www.getzola.org/">Zola</generator> | ||
<updated>{{ last_updated | date(format="%+") }}</updated> | ||
<id>{{ feed_url | safe }}</id> | ||
{%- for page in pages %} | ||
<entry xml:lang="{{ page.lang }}"> | ||
<title>{{ page.title }}</title> | ||
<published>{{ page.date | date(format="%+") }}</published> | ||
<updated>{{ page.updated | default(value=page.date) | date(format="%+") }}</updated> | ||
<author> | ||
<name> | ||
{%- if page.authors -%} | ||
{{ page.authors[0] }} | ||
{%- elif config.author -%} | ||
{{ config.author }} | ||
{%- else -%} | ||
Unknown | ||
{%- endif -%} | ||
</name> | ||
</author> | ||
<link rel="alternate" href="{{ page.permalink | safe }}" type="text/html"/> | ||
<id>{{ page.permalink | safe }}</id> | ||
<content type="html">{{ page.content }}</content> | ||
</entry> | ||
{%- endfor %} | ||
</feed> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
title = "A transparent page" | ||
description = "" | ||
date = 2018-10-10 | ||
authors = ["page@example.com (Page Author)"] | ||
+++ |