Skip to content

Listing feed: shortcodes in website.description are not resolved #14238

@gordonwoodhull

Description

@gordonwoodhull

Bug description

Shortcodes used in website.description are not resolved in the listing feed XML output. The raw shortcode syntax appears in the <description> element of the generated RSS feed.

This is the same root cause as #14237 (shortcodes in website.title not resolved in llms.txt): websiteDescription(project.config) reads the raw YAML value without passing it through Pandoc's shortcode resolution.

Affected code: src/project/types/website/listing/website-listing-feed.ts:125

const feedDescription = options.description ||
    format.metadata[kDescription] as string ||
    websiteDescription(project.config) || "";

Steps to reproduce

quarto create project website issue-feed
cd issue-feed

Edit _quarto.yml:

project:
  type: website

website:
  title: "My Site"
  description: "A site about {{< env DEMO >}}"
  site-url: "https://example.com"
  navbar:
    left:
      - href: index.qmd
        text: Home

format:
  html:
    theme: cosmo

Create _environment:

DEMO="testing"

Create index.qmd:

---
title: "Posts"
listing:
  contents: "*.qmd"
  feed: true
---

Create post1.qmd:

---
title: "First Post"
date: "2024-01-01"
---

A post.

Then render and inspect the feed:

quarto render
grep '<description>' _site/index.xml

Actual behaviour

<description>A site about {{&lt; env DEMO &gt;}}</description>

Expected behaviour

<description>A site about testing</description>

Testing infrastructure note

There is currently no smoke-all test infrastructure for verifying feed XML content. Adding a test for this would require:

  1. A new ensureFeedRegexMatches verify function in tests/verify.ts (similar to ensureLlmsTxtRegexMatches) that derives the .xml path from the HTML output path
  2. Registering it in the verifyMap in tests/smoke/smoke-all.test.ts
  3. A smoke-all test project under tests/docs/smoke-all/website/ with a listing + feed configuration

The existing tests/smoke/site/render-listings.test.ts only checks HTML elements, not feed content.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglistingsshortcodesissues related to shortcodes

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions