ASAP after work I checked the validity through validator.w3.org/feed/ and in fact there were some issues with it.
Apparently a mismatched tag
</link> was causing the parser to go berserk.
Stripped away all the tags I didn’t need, and this is the resulting version of
This file is processed with devblog and loops through the collections of posts, creating a list of
<item> elements that represent the RSS feed.
reverse nunjucks filter is needed because files are listed in alphabetical order, which means I would have the oldest post first otherwise.
Validating the RSS feed in the CI
I wanted to add this build step in the Continuous Integration I have set up with a GitHub Actions workflow.
If the validation of the RSS feed fails, the CI should not deploy a new version of the blog to cri.dev
Looking on NPM I found this little gem (pun intended) called
Which I use in my GitHub Actions workflow’s main.yml in the following way:
... - name: build run: | npm run build npm run compress - name: start server run: | npm start & - name: rss validation run: | npx feed-validator http://127.0.0.1:8080/rss.xml - name: uat uses: cypress-io/github-action@v1 - name: deploy env: AWS_ACCESS_KEY_ID: $ AWS_SECRET_ACCESS_KEY: $ run: | npm run deploy-with-assets ...
You could also run it via file with the
[-c FILE_PATH] option.
This small module calls the validation endpoint on validator.w3.org for me. In other words, this could be done with a
cURL call, but that’s for another time.
Here the code that does the API call to validator.w3.org.
Here’s the full rss.xml feed, if you’re into that.
PS: did you remember that RSS was initially called RDF Site Summary, and then Really Simple Syndication or Rich Site Summary? ~ Wikipedia