- Consider adding utility function for listing templates to read metadata
- Consider adding native filtering to listing descriptors

### Discussed in https://github.com/quarto-dev/quarto-cli/discussions/2828

<div type='discussions-op-text'>

<sup>Originally posted by **mllg** October 13, 2022</sup>
I have a folder `publications` which contains a `qmd` for multiple publications. Each `qmd` file comes with meta data about the publication in the front matter. I can now easily list all publications, e.g. with

```yaml
listing: 
    contents: 
        - "publications/*.qmd"
```

I now want to provide a different view on this listing, i.e. restrict the listing to include only publications of a specific author. I can do this with a custom listing and an ejs template which filters on pattern `"NAME"`:

```ejs

<ul class="pub-list list">
  <% for (const item of items) { %>
    <% if(item.author.match("NAME") ){ %>
      <li <%= metadataAttrs(item) %>>
        <span class="listing-title"><%= item.title %>.</span>
      </li>
    <% } %>
  <% } %>
</ul>
```

I'm wondering if there is a way to 

1. retrieve the `"NAME"` pattern from the meta data of the page which is contains the listing, or
2. a different way to pass down variables to ejs templates?

</div>
dragonstyle
2022-10-13T12:48:21Z
dragonstyle
v1.3
closed
Filtering items of listings based on meta data
https://github.com/quarto-dev/quarto-cli/issues/2833