Generate a Folder List with Dataview

I’m trying to generate a folder list

I’m trying to generate a list of folders to use as a topical index. I’d like to have a top level index page in each folder named start.md with an h1 title that could be different from the page name or the parent folder name. For example start.md in the folder data_warehouse might have an h1 title of Data Warehouse. I would like my topical index to display Data Warehouse and be linked to /data_warehouse/start.md. At the root level, start.md would contain this list of links to start.md in each folder, properly linked and aliased.

Things I have tried

So far I’ve tried using this construct in dataview

```dataview
LIST link(file.link, title)
FROM #start
```
I have tagged start.md with start and given it a title of Data Warehouse in front matter

---
tags: start
title: Data Warehouse
---

This produces the following result:

  • start: Data Warehouse

Is there a way I can lose the file name (the start: part) and just show the alias with a properly functioning link?

I guess I don’t need to extract the H1 line if I can get dataview to just show the properly linked alias or title, but it would save me a step that I might forget to do if I could just extract the H1 heading.

I would appreciate any help I can get.
Thanks in advance.

This?

```dataview
LIST 
FROM #start
```

This code kind of delivers what you’re requesting:

```dataview
LIST WITHOUT ID link(file.link, title)
FROM #start
WHERE file.name = "start"
SORT file.folder
```

But it doesn’t list which folder stuff comes from, nor does it actual use any <h1> headings, which by the way is hard to extract using just DQL queries. (Slightly easier if using dataviewjs queries, but just a little bit)

For this folder structure:
image

It reports this output (when defining title in the frontmatter of the start.md files tagged with #start):
image

To make it present a list with multiple levels according to folder structure, is something entirely else, and would for sure need dataviewjs. So please clarify what you want/need.

It might not be a good idea to have all those start.md files in your vault, but that’s your choice to make. My preference would be to have a unique field in one of the files in each folder which signifies that this is the “start” file, and then use its file name as a title.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.