diff --git a/layouts/partials/comments.html b/layouts/partials/comments.html index 9c02a92a5..819252f01 100644 --- a/layouts/partials/comments.html +++ b/layouts/partials/comments.html @@ -1,5 +1,5 @@ {{- partial "subscribe_hover.html" . }} -{{- partial "subscribe_form.html" . }} +{{- partial "subscribe_form.html" (dict "context" .) }}
{{ $comments := index $.Site.Data.comments .File.ContentBaseName | default slice }} diff --git a/layouts/partials/subscribe_form.html b/layouts/partials/subscribe_form.html index 76a927175..dc457f642 100644 --- a/layouts/partials/subscribe_form.html +++ b/layouts/partials/subscribe_form.html @@ -1,21 +1,43 @@ -{{- /* An embeddable subscribe form. Annoyingly also includes ConvertKit's script, but this will be sorted later. */}} +{{/* +An embeddable subscribe form. Annoyingly also includes ConvertKit's script, but this will be sorted later. +*/}} +{{ +$dataOptions := (dict + "settings" (dict + "after_subscribe" (dict + "action" "message" + "success_message" (.success_message | default "Success! Now check your email to confirm your subscription.") + "redirect_url" "" + ) + "recaptcha" (dict + "enabled" false + ) + "return_visitor" (dict + "action" "show" + "custom_content" "" + ) + ) + "version" "5" +) | jsonify +}} +{{$formId := .form_id | default 6549537 }}
    - + - + {{- /* Hack: Tag form submitters. Can probably be cleaned up further. + See https://monicalent.com/blog/2020/05/04/tag-and-segment-convertkit-hugo-gatsby/ */}} + {{ if .tag_id }} +
    +
    + +
    +
    + {{ end }} +
    + {{ if (.show_rss | default true) }} + {{ end }}
    diff --git a/layouts/shortcodes/lead_magnet_form.html b/layouts/shortcodes/lead_magnet_form.html index acdeb120c..c42895b69 100644 --- a/layouts/shortcodes/lead_magnet_form.html +++ b/layouts/shortcodes/lead_magnet_form.html @@ -1,48 +1,10 @@ -{{- /* An embeddable lead magnet form. Annoyingly also includes ConvertKit's script, but this will be sorted later. */}} -{{- /* TODO: reduce duplication with the subscribe_form partial. */}} - -
    - -
    -
    -
      -
      - - - {{- /* Hack: Tag form submitters. Can probably be cleaned up further. - See https://monicalent.com/blog/2020/05/04/tag-and-segment-convertkit-hugo-gatsby/ */}} - - -
      -
      -
      -
      +{{- partial "subscribe_form.html" (dict + "context" . + "email_label" "Get your copy by email today" + "form_id" 6554492 + "show_rss" false + "submit_label" "Submit" + "success_message" "Success! Now check your email to get your PDF guide." + "tag_id" 5001948 + "uid" "26c0fa1a04" +) }} diff --git a/layouts/shortcodes/subscribe_form.html b/layouts/shortcodes/subscribe_form.html index 57110c9bf..396de824a 100644 --- a/layouts/shortcodes/subscribe_form.html +++ b/layouts/shortcodes/subscribe_form.html @@ -1 +1 @@ -{{- partial "subscribe_form.html" . }} +{{- partial "subscribe_form.html" (dict "context" .) }}