---
title: "05 Templates"
canonical_url: https://mdflow.cz/share/c/h0L7MvX5Cy5sST3qPnApqHOmrQ36JTVy169qJMtDMya9Kc30zm04cg9OuPSSPwvj/0748c8b4-83f4-4af8-a81c-303c8dacfa71
md_url: https://mdflow.cz/share/c/h0L7MvX5Cy5sST3qPnApqHOmrQ36JTVy169qJMtDMya9Kc30zm04cg9OuPSSPwvj/0748c8b4-83f4-4af8-a81c-303c8dacfa71.md
visibility: public
---

# Web Clipper: Templates

A template decides what a clipped document looks like. Create several, and the clipper picks the right one automatically for each kind of page.

## What a template controls

For each template you customize:

- **The document name.**
- **The destination folder.**
- **The properties** (frontmatter) — see [07 Properties](/doc/ed2210c4-8301-4474-b2e3-5af726a8d4c4).
- **The document content.**

## Template triggers — automatic selection

This is the feature that makes templates worth setting up.

A template can be **selected automatically** based on:

- **A URL pattern** — everything from `arxiv.org` uses the Paper template.
- **Schema.org data** — any page that declares itself a `Recipe` uses the Recipe template.

Set the triggers once and the clipper stops asking. A news article, a research paper and a product page each get filed and formatted correctly without a decision from you.

## Template logic

Templates support real logic, not just substitution:

- **Conditionals** — include a section only if the page has an author.
- **Loops** — iterate over a list of authors, tags, or ingredients.
- **Variable assignment** — compute something once and reuse it.

**Syntax is validated inline**, so a broken template tells you at edit time rather than producing a mangled clip.

## Managing templates

- **Import and export** templates.
- **Copy a template as JSON** — the easy way to share one, or to hand it to an AI assistant and ask for a modification.
- **Reset the default template** to its original state if you have experimented it into a corner.

## A worked example

A template for research papers, triggered on `arxiv.org`:

- **Name:** the paper's title.
- **Folder:** `Research / Papers`.
- **Properties:** authors as a list, published date as a date, the URL as text.
- **Content:** the abstract, then your notes, then the full text.

Every arXiv page you clip from then on lands correctly filed, correctly named, and correctly structured — with no decisions at clip time.

## Where the pieces fit

Templates are the frame. The things you put in them come from elsewhere:

- **Variables** pull data out of the page — [06 Variables and Filters](/doc/3bffaf4b-3def-4db6-8c53-df72d1066906).
- **Filters** reshape those values — same document.
- **Properties** become typed frontmatter — [07 Properties](/doc/ed2210c4-8301-4474-b2e3-5af726a8d4c4).
- **Prompt variables** ask a language model for something the page does not state outright — [08 AI Interpreter](/doc/4083577d-96da-4ee2-8e3b-1faee2410775).

Start with one template and a trigger for a site you read often. That is where the payoff is clearest.
