fix: valid feed.xml output, repoint /python-lectures/ redirect to /lectures/#208
Merged
Conversation
Two pre-existing bugs found while verifying the GitHub Actions deploy migration (#199): - feed.xml truncated post content *after* escaping it, slicing XML entities like " in half and producing an invalid feed. Reorder to strip_html | truncate | escape so truncation happens on plain text and escaping is applied last. - /python-lectures/ redirected to /projects/#filter=lecture, a page that has never existed (404). Point it at /lectures/, where the lecture series are listed today. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
✅ Deploy Preview for grand-swan-ca5201 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes two pre-existing site issues uncovered during the GitHub Pages Actions deploy migration: invalid RSS feed XML output and a broken /python-lectures/ redirect target.
Changes:
- Update
feed.xmlto strip HTML and truncate before escaping to avoid truncation splitting escape sequences and producing invalid XML. - Repoint
/python-lectures/redirect from a non-existent/projects/page to the existing/lectures/page.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
pages/python-lectures.md |
Redirects /python-lectures/ to /lectures/ instead of the non-existent /projects/ route. |
feed.xml |
Reorders Liquid filters to produce valid RSS description text (strip HTML → truncate → escape). |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two pre-existing bugs discovered while verifying the GitHub Actions deploy migration (#199). Neither was a regression — both pre-date the deployment switch.
1.
feed.xmlproduced invalid XMLThe template rendered post descriptions with
{{ post.content | escape | truncate: '400' }}. Truncating after escaping slices XML entities in half (e.g."→&quo), so the live feed failed XML validation with ~10 parser errors.Fix: reorder to
{{ post.content | strip_html | truncate: 400 | escape }}— truncate plain text first, escape last.strip_htmlalso removes markup that previously appeared escaped inside descriptions, so readers get clean text summaries.Verified:
xmllint --noout _site/feed.xmlpasses on aJEKYLL_ENV=productionbuild.2.
/python-lectures/redirected to a page that has never existedpages/python-lectures.mdhadredirect_to: https://quantecon.org/projects/#filter=lecture, but/projects/404s and is absent from the sitemap both before and after the deploy migration — the filterable projects page it pointed at was never shipped. Visitors following the redirect landed on a 404.Fix: point it at
/lectures/, where the lecture series are listed today.🤖 Generated with Claude Code