List

Table of contents

list: lists the Markdown files in your project by their metadata, like a folder or a tag, and they can be filtered by any of their tags.

Content

Use case: Content - Overwrites content it controls.

list: folder: 'notes'
- [Getting started](docs/_notes/_1-getting-started.md)
- [Setup](docs/_notes/_2-setup.md)

Template

Use case: Template - Accepts content and renders to HTML only.

A <{ list: }> block's template repeats like a loop, for each file it lists.

<{ :list folder: 'nodes' }> renders the same links as the Content example, but writes nothing into the file.

To render the files with your own template, add a variable like page after list:

<{ list: page folder: 'nodes' }>
- [{page.title}]({page.path})
<{ :list }>

Which when used on this website produces:

Sorting

Sort lists by their metadata with order:

<{ list: page folder: 'nodes' order: :title }>
- [{page.title}]({page.path})
<{ :list }>

Which when used on this website produces:

Overriding

list: is a node too, so a project can list files its own way with a List node that overrides rewrite or adds render, like class List < Raindown::List, where files(metadata:) gives each file's front matter, path and content, for its links and its template.