{{- /* CraftForms embed shortcode for Hugo. Usage in content (Markdown): {{* craftform key="aHR0cHM6Ly9mb3Jtcy5leGFtcGxlLmNvbQ.abc123" */>}} {{* craftform key="…" resourceId="42" */>}} Reads the WordPress base URL from `key` param `wpUrl`, else site param `params.craftforms.wpUrl` in your hugo config. */ -}} {{- $key := .Get "key" -}} {{- $wpUrl := .Get "wpUrl" | default (index site.Params "craftforms" "wpUrl") -}} {{- $resourceId := .Get "resourceId" -}} {{- if not $key -}} {{- errorf "craftform shortcode: `key` is required (page %s)" .Page.File.Path -}} {{- end -}} {{- if not $wpUrl -}} {{- errorf "craftform shortcode: set `wpUrl` param or params.craftforms.wpUrl in config (page %s)" .Page.File.Path -}} {{- end -}} {{- $base := strings.TrimRight "/" $wpUrl -}}