What I’m trying to do
I’m trying to use dataviewjs to query all files which have the YAML frontmatter ‘type’ of ‘Index’ (see image below). The frontmatter of ‘type’ is a list and the contents are always a wikilink (e.g., ‘[[Index]]’).
The YAML would look like:
type:
- “[[Index]]”
Things I have tried
Here is the code I’ve been working with.
const headers = ["Name"];
const pages = dv.pages().where(p => p.file.frontmatter.type.includes("Index"));
dv.header(3, "All Index Notes");
dv.table(headers, pages.map(p => [p.file.link]));
I have also tried
- .where(p => p.file.type == “Index”)
- .where(p => p.file.frontmatter.type == “Index”)
- .where(p => p.file.type === “Index”)
- .where(p => p.file.frontmatter.type === “Index”)
Many thanks in advance!