bim

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

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