How to use date
for field-types
in nested item for custom listings
#10942
-
DescriptionI have a date field in a YAML file that is nested under a main heading. I want that date to be formatted via Quarto's See this GitHub for an example of this. I have a YAML file that looks a bit like: - section: Test section
entries:
- title: Subsection
start: "2022-12-01"
end: "2022-12-01"
- section: Test section 231
entries:
- title: Subsection 3
start: "2022-12-01"
end: "2022-12-02" And I have an EJS template that has something like this: <% for (const item of items) { %>
## <%= item.section %>
<% for (const entry of item.entries) { %>
<%= entry.title %>
: <%= entry.start %>
: <%= entry.end %>
<% } %>
<% } %> And my quarto doc is like this: ---
date-format: "medium"
listing:
- id: sections
template: sections.ejs
contents: data.yml
field-types:
# entries.start: date doesn't work either
start: date
end: date
---
::: {#sections}
::: And the project:
type: website
website:
title: "test"
format:
html:
theme: cosmo
toc: true It ends up formatting as-is (as |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Could you share a small self-contained "working" (reproducible) example to work with, i.e., a complete Quarto document or a Git repository? The goal is to make it as easy as possible for us to recreate your problem so that we can fix it: please help us help you! Thanks. You can share a self-contained "working" (reproducible) Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four If you have multiple files (and if it is absolutely required to have multiple files), please share as a Git repository.
Additionally and if not already given, please share the output of |
Beta Was this translation helpful? Give feedback.
From my testing and looking at the codebase, I don't think
field-types
supports nested field, only top-level fields.quarto-cli/src/project/types/website/listing/website-listing-template.ts
Lines 90 to 93 in 7194553