Mordoc

Cards and Card Grids

Create visual groups of links with cards and card grids.

4 MIN READ

Cards are useful when you want to guide readers toward a few related pages or choices.

A card is a small content block. A card grid arranges multiple cards together.

Use cards when a reader needs to choose where to go next. For example, a homepage might link to the most important sections of a site.

Add a card grid

Start with a cardGrid:

Markdown
{% cardGrid cols="3" %}
{% /cardGrid %}

The cols value controls how many columns the grid tries to show on wide screens. Common values are 2 and 3. Mordoc will still adapt the layout on smaller screens.

Card grid attributes

AttributeDescriptionValuesRequired
colsPreferred number of columns on wide screens1-4 (default 3)Optional

Add cards inside the grid

Each card needs a title:

Markdown
{% cardGrid cols="2" %}
{% card title="Install" path="/guides/install" %}
Install the product and check that it runs.
{% /card %}
{% card title="Configure" path="/guides/configure" %}
Adjust settings for your project.
{% /card %}
{% /cardGrid %}

The title field is required. Use path when the card should link somewhere. The other card fields are optional.

Choose a card style

Mordoc supports a few card styles:

  • A plain card, with just a title, a path, and body text
  • A card with a tag, for a short badge like New or Start here
  • A card with an icon, for a small icon next to the title
  • A card with an image, for a larger image above the title

Simple cards

Use a plain card when the title and a short sentence are enough to help the reader decide.

Markdown
{% cardGrid cols="2" %}
{% card title="Build and Deploy" path="/publishing/build-your-site" %}
Generate a static site and deploy it to any hosting platform in minutes.
{% /card %}
{% card title="Preview Before Publishing" path="/publishing/preview-before-publishing" %}
See exactly how your site looks before it goes live — no surprises.
{% /card %}
{% /cardGrid %}

How it renders

Simple cards with badge

Use tag for short labels like New, Start here, or Recommended. Use tags sparingly. If every card has a tag, the tags stop feeling helpful.

Markdown
{% cardGrid cols="2" %}
{% card title="Quickstart" path="/getting-started/create-project" tag="Start here" %}
Begin with the fastest path through the docs.
{% /card %}
{% card title="Callouts" path="/writing-content/callouts" tag="New" %}
Highlight notes, tips, warnings, and important messages in Mordoc pages.
{% /card %}
{% /cardGrid %}

How it renders

Cards with icon

Add icon to show a small icon next to the title. icon renders in a small square box without cropping, so a square icon, ideally an SVG, fits best.

Markdown
{% cardGrid cols="3" %}
{% card title="Getting Started" path="/getting-started/create-project" icon="/icons/card-icons/getting-started.svg" %}
Create your first project, run it locally, and learn how Mordoc works from the ground up.
{% /card %}
{% card title="Writing Content" path="/writing-content/markdown-basics" icon="/icons/card-icons/writing.svg" %}
Markdown basics, callouts, tables, cards, landing pages, and everything in between.
{% /card %}
{% card title="Configuration" path="/configuration/site-configuration" icon="/icons/card-icons/configuration.svg" %}
Tailor your site with navigation, branding, themes, variables, and multi-language support.
{% /card %}
{% /cardGrid %}

How it renders

Cards with image

Add image to show a larger image above the title.

Markdown
{% cardGrid cols="3" %}
{% card title="Český Krumlov" image="/images/content-images/cesky-krumlov.jpg" %}
A fairy-tale town in South Bohemia, wrapped by a bend in the Vltava.
{% /card %}
{% card title="Iceland" image="/images/content-images/iceland.jpg" %}
Waterfalls, glaciers, and black sand beaches around every bend.
{% /card %}
{% card title="Reine" image="/images/content-images/reine.jpg" %}
A fishing village tucked beneath the peaks of the Lofoten Islands.
{% /card %}
{% /cardGrid %}

How it renders

Český Krumlov

A fairy-tale town in South Bohemia, wrapped by a bend in the Vltava.

Iceland

Waterfalls, glaciers, and black sand beaches around every bend.

Reine

A fishing village tucked beneath the peaks of the Lofoten Islands.

Match the expected aspect ratio

image renders in a fixed 16:9 box and is cropped to fill it, so a 16:9 source image (for example 800x450 or 1200x675) avoids losing its edges.

Keep card text short

Card text should help readers choose. One short sentence is usually enough.

Card attributes

AttributeDescriptionValuesRequired
titleThe card headingAny textRequired
pathThe page or URL the whole card links toA path or URLOptional
iconA small icon shown next to the title. Ignored if image is setIcon pathOptional
imageA larger image shown above the titleImage pathOptional
tagA short badge shown above the title, such as New or Start hereAny textOptional

Next step