Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixos-homepage
base: 52b2a6f3fe90
Choose a base ref
...
head repository: NixOS/nixos-homepage
compare: c2b7827af52b
Choose a head ref
  • 9 commits
  • 4 files changed
  • 2 contributors

Commits on Sep 27, 2018

  1. Copy the full SHA
    c1930d2 View commit details
    Browse the repository at this point in the history
  2. Fix RSS encoding of news items

    The current news-rss.xml fails http://www.feedvalidator.org for a couple
    of reasons, making feed readers like Liferea misparse it. This patch
    fixes one of those issues.
    
    As @edolstra noted in #90, HTML is not allowed directly in the RSS
    `<description>` tag. Instead it's supposed to be a text node, where the
    text can be parsed as HTML. So e.g. an `<a>` tag needs to be written in
    the feed as `&lt;a&gt;`.
    
    This could be handled more easily in an Atom feed, which allows tags
    from namespaces like XHTML to be embedded directly as long as the
    namespaces are declared properly.
    
    This could also be simpler if xsltproc supported the XPath Functions 3.0
    standard, which defines a `serialize` function that does what the
    mode="serialize" template does in this patch.
    jameysharp committed Sep 27, 2018
    Copy the full SHA
    eecc8e0 View commit details
    Browse the repository at this point in the history
  3. Fix pubDate timestamps in news RSS feed

    The current news-rss.xml fails http://www.feedvalidator.org for a couple
    of reasons, making feed readers like Liferea misparse it. This patch
    fixes one of those issues.
    
    The RSS pubDate element is required to be an RFC-822 date-time. The
    entries in news.xml did not conform to that specification for two
    reasons: a missing comma, and swapping the month and day fields.
    
    So I fixed both of those issues in news.xml, and then fixed news.xsl to
    extract the date substring at its new offset.
    
    This does mean that the HTML version of the news has its month and day
    swapped now, and frankly I liked it better in the previous month-day
    order.
    
    If desired the previous output can be recovered, by either continuing
    using the substring-pasting approach but chopping up the substrings
    further, or changing news.xml to use ISO 8601 date-times and using the
    http://exslt.org/date/ extension functions.
    jameysharp committed Sep 27, 2018
    Copy the full SHA
    9ea6d21 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    373a47d View commit details
    Browse the repository at this point in the history
  5. Fix news RSS channel properties

    The channel's <link> tag should point to an HTML version of the same
    content as the feed, so it's better to link to /news.html than to /.
    
    In addition, the RSS specification says:
    
    "the image <title> and <link> should have the same value as the
    channel's <title> and <link>."
    
    http://www.rssboard.org/rss-specification#ltimagegtSubelementOfLtchannelgt
    
    Finally, feedvalidator.org says the feed document should include a link
    to the canonical URL for that feed:
    
    http://www.feedvalidator.org/docs/warning/MissingAtomSelfLink.html
    jameysharp committed Sep 27, 2018
    Copy the full SHA
    aa324d0 View commit details
    Browse the repository at this point in the history
  6. Fix news RSS item properties

    The item's <link> tag should point to an HTML version of the same
    content as the item. However, there is no URL for each item in the
    current site, so there's no good place to link to. Fortunately, the link
    tag is not required when a description is present, so we can just drop
    that tag entirely.
    
    Also, each item should have some sort of unique ID in the <guid> tag.
    If a feed reader sees an item that's different from any item it has seen
    before, then the guid allows the reader to distinguish between new items
    and items that have been edited.
    
    http://www.feedvalidator.org/docs/warning/MissingGuid.html
    
    Since it has almost never happened that two items were posted with the
    same pubDate, I've chosen to use the pubDate itself as the guid. There
    were three duplicates, but I've made them unique by adding one second to
    the pubDates of the three duplicates that appear earlier in the file, so
    that sorting by descending pubDate would leave the file order unchanged.
    jameysharp committed Sep 27, 2018
    Copy the full SHA
    7653067 View commit details
    Browse the repository at this point in the history
  7. Mark news RSS feed as "complete" per RFC5005

    First, I removed the maxItem limit from the RSS feed. (It's still used
    for the HTML version.) The maxItem limit of 1000 was effectively
    infinite at the rate news items are being published, and each item is
    quite small so there isn't much bandwidth cost to publishing a lot of
    them anyway.
    
    Second, since the feed does contain every entry ever posted, it is a
    valid "complete feed" in the sense of RFC5005 section 2, so add the tag
    marking it as such.
    
    If the RSS feed ever gets too large, then RFC5005 section 4 describes
    how to paginate it into archived feeds.
    jameysharp committed Sep 27, 2018
    Copy the full SHA
    2d0cbfb View commit details
    Browse the repository at this point in the history

Commits on Mar 18, 2019

  1. Copy the full SHA
    5a0140e View commit details
    Browse the repository at this point in the history
  2. Merge pull request #242 from jameysharp/rss-fixes

    RSS fixes
    grahamc committed Mar 18, 2019
    Copy the full SHA
    c2b7827 View commit details
    Browse the repository at this point in the history