From ee8794d5209a8852f9f6abc9516a348ba71a0eac Mon Sep 17 00:00:00 2001 From: Tim Hostetler <6970899+thostetler@users.noreply.github.com> Date: Thu, 18 Jun 2026 15:51:23 -0400 Subject: [PATCH] fix(feed): fix XML escaping, deduplication, and add summaries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit post.author and post.title were missing xml_escape, causing a parse error on posts with '&' in those fields. The limit:10 ran before the category filter, filling the window with same-date posts from both blog/ and scixblog/ collections. The 'contains blog' check matched scixblog as a substring, doubling every entry. post.id, post.url, and the self-link href were also unescaped. The summary fallback double-encoded HTML entities by running xml_escape after strip_html without first decoding the entities strip_html leaves intact. - Apply xml_escape to post.title, post.author, post.id, post.url - Upgrade self-link href from http to https - Pre-filter with where: "category", "blog" so limit:10 applies to the right set - Drop the now-redundant in-loop category check - Add to each entry — uses post.description from front matter if present, falls back to first 50 words of rendered text - Fix double-encoding in fallback: decode HTML entities before xml_escape --- help/common/feed.xml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/help/common/feed.xml b/help/common/feed.xml index 9f56cb2f..1a75e149 100644 --- a/help/common/feed.xml +++ b/help/common/feed.xml @@ -6,7 +6,7 @@ layout: null NASA/SAO Astrophysics Data System - + {{ site.time | date_to_xmlschema }} https://ui.adsabs.harvard.edu/ @@ -15,20 +15,24 @@ layout: null Copyright © 2015, NASA/SAO Astrophysics Data System - {% for post in site.posts limit:10 %} - {% if post.category contains 'blog' %} + {% assign blog_posts = site.posts | where: "category", "blog" %} + {% for post in blog_posts limit: 10 %} - http://adsabs.github.io{{ post.id }} - - {{ post.title }} + http://adsabs.github.io{{ post.id | xml_escape }} + + {{ post.title | xml_escape }} {{ post.date | date_to_xmlschema }} {{ post.date | date_to_xmlschema }} - {{ post.author }} + {{ post.author | xml_escape }} + {% if post.description %} + {{ post.description | xml_escape }} + {% else %} + {{ post.content | strip_html | replace: '&', '&' | replace: '<', '<' | replace: '>', '>' | replace: '"', '"' | replace: ''', "'" | truncatewords: 50 | xml_escape }} + {% endif %} {{ post.content | xml_escape }} - {% endif %} {% endfor %}