Macros in Craft CMS (and Twig in general) are insanely useful. You can use them to keep your code nice and DRY (Don't Repeat Yourself) - reducing redundancy, making maintenance easier, and making development faster.

In this example, I'll walk you through how to build a simple 'card' interface. In UI terms, Cards are often little widgets that preview content and when clicked upon open the full thing. Many sites have different kinds of cards - some might be clickable, some might just be static; some might have images, some may not.

Here's how we would construct a basic macro.