Skip to content

Listing pages can't read custom Lua-created YAML metadata of their input filesΒ #11866

@andrewheiss

Description

@andrewheiss

Bug description

This is a more complex bug report than normal because it involves a whole website. A full explanation and minimal reproducible example is available at https://github.com/andrewheiss/listing-with-metadata

Basically, if you use a Lua filter to add pandoc metadata to a .qmd file (like h3-to-metadata.lua), that new YAML metadata is inaccessible in the EJS template for a custom listing page.

According to @cscheid over at πŸ¦‹ Bluesky:

Thanks. I understand what's happening, and it's a bug, but a hard one to fix.

What's going on is that yaml metadata only appears in markdown output as a special case, more or less so that you can emit markdown with metadata blocks. (1/n)

Custom listings do read metadata, but they read the metadata of the input .qmd, because the HTML output has no way to store the resulting metadata your Lua filter might have created.

I think I might have a design that solve this, but I need to test some stuff. (2/n)


As a workaround, it's possible to use an approach inspired by @mcanouil and generate a YAML data file that the listing page can reference (reprex for that here: https://github.com/andrewheiss/listing-with-posts-yaml-data), but it's a mess and fragile πŸ€·β€β™‚οΈ

Steps to reproduce

See https://github.com/andrewheiss/listing-with-metadata for full details and a reproducible example mini website

Expected behavior

It would be cool if somehow a page that contains listings could read the Pandoc Meta object of its input .qmd files after Lua scripts inject extra metadata into it

Actual behavior

Listing pages can't see customly-injected Pandoc metadata

Your environment

  • IDE: RStudio, Positron, terminal, everywhere :)
  • OS: MacOS Sequoia 15.2

Quarto check output

❯ quarto check
Quarto 1.7.3
[βœ“] Checking environment information...
      Quarto cache location: /Users/andrew/Library/Caches/quarto
[βœ“] Checking versions of quarto binary dependencies...
      Pandoc version 3.4.0: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.46.3: OK
      Typst version 0.11.0: OK
[βœ“] Checking versions of quarto dependencies......OK
[βœ“] Checking Quarto installation......OK
      Version: 1.7.3
      Path: /Applications/quarto/bin

[βœ“] Checking tools....................OK
      TinyTeX: (external install)
      Chromium: (not installed)

[βœ“] Checking LaTeX....................OK
      Using: TinyTex
      Path: /Users/andrew/Library/TinyTeX/bin/universal-darwin
      Version: 2024

[βœ“] Checking basic markdown render....OK

[βœ“] Checking Python 3 installation....OK
      Version: 3.13.1
      Path: /opt/homebrew/opt/[email protected]/bin/python3.13
      Jupyter: 5.7.2
      Kernels: python3

[βœ“] Checking Jupyter engine render....OK

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinglistingsmetadataIssues involving metadata resolution in quarto-cli cells, documents, and projects.needs-design

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions