From 7d5ce5c2302aba9c18dd46256cf281edfb55d9d7 Mon Sep 17 00:00:00 2001 From: One <43485962+c-git@users.noreply.github.com> Date: Mon, 30 Oct 2023 14:03:29 -0400 Subject: [PATCH] Document author (#2347) * Add author to documentation for config.toml * Add explanation of how author is used for feeds --- .../getting-started/configuration.md | 3 +++ .../documentation/templates/feeds/index.md | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/docs/content/documentation/getting-started/configuration.md b/docs/content/documentation/getting-started/configuration.md index 670725fe..c6e57b81 100644 --- a/docs/content/documentation/getting-started/configuration.md +++ b/docs/content/documentation/getting-started/configuration.md @@ -77,6 +77,9 @@ feed_filename = "atom.xml" # files are always copied, regardless of this setting. hard_link_static = false +# The default author for pages +author = + # The taxonomies to be rendered for the site and their configuration of the default languages # Example: # taxonomies = [ diff --git a/docs/content/documentation/templates/feeds/index.md b/docs/content/documentation/templates/feeds/index.md index e1331923..edef13a2 100644 --- a/docs/content/documentation/templates/feeds/index.md +++ b/docs/content/documentation/templates/feeds/index.md @@ -17,6 +17,20 @@ need to provide a template yourself. **Only pages with a date will be available.** +The author in the feed is set as +- The first author in `authors` set in the + [front matter](@/documentation/content/page.md#front-matter) +- If that is not present it falls back to the `author` in the + [Configuration](@/documentation/getting-started/configuration.md) +- If that is also not preset it is set to `Unknown`. + +Note that `atom.xml` and `rss.xml` require different formats for specifying the +author. According to [RFC 4287][atom_rfc] `atom.xml` requires the author's +name, for example `"John Doe"`. While according to the +[RSS 2.0 Specification][rss_spec] the email address is required, and the name +optionally included, for example `"lawyer@boyer.net"` or +`"lawyer@boyer.net (Lawyer Boyer)"`. + The feed template gets five variables: - `config`: the site config @@ -63,3 +77,6 @@ In order to enable the tag feeds as well, you can overload the `block rss` using {% endblock rss %} ``` Each tag page will refer to it's dedicated feed. + +[atom_rfc]: https://www.rfc-editor.org/rfc/rfc4287 +[rss_spec]: https://www.rssboard.org/rss-specification#ltauthorgtSubelementOfLtitemgt \ No newline at end of file