zola/components
Jeremy Kerr 63054a96d2 templates: add base URL for feed content (#2190)
Relative links in the entry content do not currently have a base URI, so
will be resolved relative to the feed URI:

Given an entry with the content:

    <a href="some-resource.bin">

And URIS of:

 * entry: https://example.org/blog/some-entry/
 * feed:  https://example.org/atom.xml

The link URI will end up as:

    https://example.org/some-resource.bin

rather than the URI that ends up resolved in the rendered page:

   https://example.org/blog/some-entry/some-resource.bin

The atom and RSS formats allow for an xml:base attribute (itself
specified in [1]) to provide a base URI of a subset of a document. This
change adds xml:base attributes to each entry, using the page permalink.

This gives us something equivalent to:

    <entry>
     <content xml:base="https://example.org/blog/some-entry/">
      <![CDATA[
       <a href="some-resource.bin">
      ]]>
     </content>
    </entry>

[1]: https://www.w3.org/TR/xmlbase/

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2023-12-18 23:24:06 +01:00
..
config Implement Default for LanguageOptions (#2145) 2023-03-19 20:36:25 +01:00
console add link_checker settings for external_level and internal_level (#1848) 2022-05-11 21:54:34 +02:00
content Pass section.generate_feed 2023-02-24 22:20:26 +01:00
errors Remove unused deps thanks to cargo-machete 2022-04-27 19:49:57 +02:00
imageproc Remove dummy test 2023-03-19 20:36:25 +01:00
libs Update toml lib 2023-02-16 20:49:03 +01:00
link_checker Speedup "zola check" command by reusing the Client (#2171) 2023-12-18 23:24:06 +01:00
markdown Revert "Allow external links to start with "www.*" (#2100)" 2023-03-19 20:36:25 +01:00
search Remove code blocks from search index 2023-02-16 20:49:03 +01:00
site Fix tests 2023-03-19 20:36:25 +01:00
templates templates: add base URL for feed content (#2190) 2023-12-18 23:24:06 +01:00
utils Revert "Allow external links to start with "www.*" (#2100)" 2023-03-19 20:36:25 +01:00