View .md

MuxForms on Hugo is a layouts/partials/muxforms-contact.html partial with the div and script, included from content/contact.md. Allow your GitHub Pages, Netlify, or Cloudflare origin.

Docs

Hugo

Hugo builds fast static HTML—include a partial once and reuse the embed on every contact page.

Hugo

FileRole
layouts/partials/muxforms.htmlSnippet
content/contact.md{{ partial }} call
configbaseURL for allowlist hint
DeployAny static host

layouts/partials/muxforms-contact.html

<div data-form-id="{{ .Site.Params.muxFormId | default "FORM_UUID" }}"></div>
<script src="https://www.muxforms.com/embed.js" defer></script>

content/contact.md

---
title: "Contact"
layout: contact
---

layouts/contact.html

{{ define "main" }}
  <h1>Contact</h1>
  {{ partial "muxforms-contact.html" . }}
{{ end }}

Common questions

Goldmark raw HTML?
Partials render unescaped HTML by default in layouts.
Multilingual sites?
One partial; translate headings in content files.
Environment-specific form id?
Use Hugo params in config.toml for dev vs prod UUIDs.
GitHub Pages?
See /docs/github-pages for origin allowlist.

Hugo speed, hosted forms.

Params per environment without rebuilding MuxForms.

Upgrade to Pro