Directives
Directives are special syntax for dynamic content in Markdown.
Recent Directive
Show recent items from a collection:
This generates an HTML list:
<ul class="recent-list">
<li>
<a href="/blog/post/">Post Title</a>
<time datetime="2024-01-15">2024-01-15</time>
</li>
...
</ul>
Supported Collections
{{recent blog N}}- Recent blog posts{{recent notes N}}- Recent notes{{recent snippets N}}- Recent snippets{{recent talks N}}- Recent talks{{recent projects N}}- Recent projects{{recent recipes N}}- Recent recipes
Usage
Typically used on your homepage:
# Welcome
My latest writing:
Recent notes:
Styling
The generated list has the class recent-list. Style it in your layout:
.recent-list {
list-style: none;
padding: 0;
}
.recent-list li {
padding: 0.5rem 0;
border-bottom: 1px solid var(--border);
}
.recent-list time {
color: var(--muted);
margin-left: 1rem;
}
Related: #directives #templates @documentation