article-list

Renders a sorted list of articles from a content directory.

(Last Edited)

::article-list queries a content directory at build time and renders its articles as a linked list. Articles are sorted by date descending; undated articles sort last. Draft articles (draft: true) are excluded.

index.mdx handlingindex.mdx at the root of the queried directory is always excluded: it is the section page for that directory, not a peer article. A subdirectory's index.mdx (e.g. subdir/index.mdx) is always treated as a peer and appears at the subdirectory's slug (subdir), regardless of whether recursive is set. The recursive flag only controls whether the contents inside subdirectories are also collected.

Maps to the <ArticleList /> React component via the kebab-case → PascalCase directive convention.

Reference

::article-list{dir=guides}  
::article-list{dir=guides recursive limit=5}
AttributeTypeRequiredDefaultDescription
dirstringYesDirectory path relative to content/.
recursivebooleanNofalseWhen true, collects articles from all nested subdirectories.
limitnumberNoMaximum number of articles to show.

Examples

All articles in a directory

::article-list{dir=directives/article-list}

With a limit

::article-list{dir=directives/article-list limit=1}

Recursive — include subdirectories

::article-list{dir=directives/article-list recursive}