# Templates Templates are HTML files stored in the `templates/` directory. Hunim wraps Markdown content inside the matching template before writing it to `public/`. ## Default template Create `templates/default.html` and it will be applied to every Markdown file that does not specify a custom template:
<!DOCTYPE html>
<html lang="{{ .Lang }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ .Title }}</title>
{{ .MetaTags }}
<link rel="stylesheet" href="/style.css">
</head>
<body>
{{ .Content }}
</body>
</html>
## Template variables
| Variable | Description |
|---|---|
{{ .Content }} | The rendered HTML from the Markdown file. |
{{ .Title }} | The title field from frontmatter. |
{{ .Date }} | The formatted date (e.g. November 19, 2024). Only set for feed posts. |
{{ .Author }} | The author field from frontmatter. Only set for feed posts. |
{{ with .PrevInSection }}...{{ end }} | For feed posts, renders the block only when an older neighboring post exists. Inside the block, use {{ .RelPermalink }} and {{ .Title }}. |
{{ with .NextInSection }}...{{ end }} | For feed posts, renders the block only when a newer neighboring post exists. Inside the block, use {{ .RelPermalink }} and {{ .Title }}. |
{{ .Lang }} | The languageCode from hunim.toml. |
{{ .MetaTags }} | Generated <meta> tags for SEO (og:title, description, canonical URL). |
<body>
{{ nav }}
<main>
{{ .Content }}
</main>
{{ footer }}
</body>
## Auto-reload
When you run `hunim server`, a small polling script is injected automatically before the closing `` of every page, so the browser refreshes on file changes. You don't need to add anything to your templates, and production builds (`hunim build`) contain no such script.