Sort out RSS feed

Have four VScode windows up for four sites

  1. astro-blog. Native site from content collection called 'blog'
  2. astro-local. Local WP fed site. Deployed to Cloudflare directly with % npm run deploy
  3. astro-test. First site. Local without content collection
  4. astro-wpress. Cloud fed WP site

Compare and contrast these files

  1. /astro.config.mjs
  2. /src/layouts/Layout.astro
  3. src/pages/rss.xml.js

Issues found

  • astro-blog. Didn't have an RSS specification in Layout.astro.
    Correct feed picked up by ncvp.co.uk/rss from footer icon.
    No sign of 'rss' in <head> in local or cloud page source.
    ncvp.co.uk must have guessed it anyway.
  • astro-test. Same issue as astro-blog.
  • astro-local. ncvp.co.uk/rss showing wrong feed url: https:///rss.xml
    This line: <link rel="alternate" type="application/rss+xml" title="al.ncvp.me RSS feed" href="/rss.xml">
    appearing in the cloud <head>
    Problem in Layout.astro. Replace href="/rss.xml" in specification link with href={`${Astro.site}rss.xml`}
    That fixed it
  • Passim. The post excerpt is usually not a good summary. What to do about this? WP and natively sourced sites.

Lessons learned

  • Don't need the <link type="application/rss+xml ...> tag, but it's probably a good idea

Test

When looking good locally, deploy to cloud and check again

Copying this post

Originated in astro-blog. Simply copy to astro-test. (Having changed category 'Devt' to 'Dev'. This needs sorting out)

Import .md into localhost/wp/wp with Import Markdown plugin. Quite good. Imports correctly and makes a classic editor post. It should be able to bulk import too.
Copy and paste into ncvp.me/wp. No need to bother with plugin there for single posts.

Rendered by index.php