article-list
Renders a sorted list of articles from a content directory.
::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 handling — index.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}| Attribute | Type | Required | Default | Description |
|---|---|---|---|---|
dir | string | Yes | — | Directory path relative to content/. |
recursive | boolean | No | false | When true, collects articles from all nested subdirectories. |
limit | number | No | — | Maximum number of articles to show. |
Examples
All articles in a directory
::article-list{dir=directives/article-list}- directives/article-list/basicsBasics
Another sample article demonstrating article-list with a date and tags.
Read - directives/article-list/introductionIntroduction
A sample article used to demonstrate the article-list directive.
Read
With a limit
::article-list{dir=directives/article-list limit=1}Recursive — include subdirectories
::article-list{dir=directives/article-list recursive}- directives/article-list/advanced/patternsCommon Patterns
Another nested sample article showing recursive collection from subdirectories.
Read - directives/article-list/advanced/techniquesAdvanced Techniques
A nested sample article inside a subdirectory for recursive listing.
Read - directives/article-list/basicsBasics
Another sample article demonstrating article-list with a date and tags.
Read - directives/article-list/introductionIntroduction
A sample article used to demonstrate the article-list directive.
Read