From 7852a69245bed2bd076930bc706a8a3cc4ed797a Mon Sep 17 00:00:00 2001 From: Serghei Iakovlev Date: Fri, 27 May 2022 15:05:47 +0200 Subject: Migrate to formspark.io --- README.md | 1 + assets/sass/_customize.scss | 2 ++ exampleSite/config.toml | 4 +++- exampleSite/content/about.md | 1 + exampleSite/content/contact.md | 2 +- exampleSite/content/thanks.md | 9 +++++++++ layouts/robots.txt | 1 + layouts/shortcodes/form-contact.html | 16 +++++++++------- .../style.scss_f300667da4f5b5f84e1a9e0702b2fdde.content | 5 +++++ 9 files changed, 32 insertions(+), 9 deletions(-) create mode 100644 exampleSite/content/thanks.md diff --git a/README.md b/README.md index 043e95f..88d7493 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ to generate high-quality editions on github.io in large quantities based on the - Unobtrusive footnotes - Metadata in OpenGraph to play nice with social media and search engines - Automatic table of content generation +- Contact form ## License diff --git a/assets/sass/_customize.scss b/assets/sass/_customize.scss index b9465af..60f463e 100644 --- a/assets/sass/_customize.scss +++ b/assets/sass/_customize.scss @@ -5,6 +5,7 @@ } #page-contact, +#page-thanks, .introduction { min-height: 40px; margin-bottom: 40px; @@ -26,6 +27,7 @@ } #page-contact .container, +#page-thanks .container, .introduction .container { margin: 10px auto; max-width: 600px; diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 9224727..31b696c 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -151,9 +151,11 @@ disableKinds = ['RSS'] [params.contact] # Formspree URL, used in contacts form - formAction = 'https://formspree.io/f/example' + formAction = 'https://submit-form.com/example' # Contact form email subject emailSubject = 'Contact form submission' + # After successful submit, where should the user be redirected? + thanksUrl = '/thanks' [params.assets] # Site icons, relative to ./static diff --git a/exampleSite/content/about.md b/exampleSite/content/about.md index 5b8fd5f..f900d71 100644 --- a/exampleSite/content/about.md +++ b/exampleSite/content/about.md @@ -45,6 +45,7 @@ for you, Kindle! - Unobtrusive footnotes - Metadata in OpenGraph to play nice with social media and search engines - Automatic table of content generation +- Contact form ## Installing and using Ed diff --git a/exampleSite/content/contact.md b/exampleSite/content/contact.md index 56147cb..05c1bb8 100644 --- a/exampleSite/content/contact.md +++ b/exampleSite/content/contact.md @@ -3,6 +3,6 @@ title: Contact description: We'd love to hear from you --- -This is an example of a custom shortcode that you can put right into your content. You will need to add a form action to the the shortcode to make it work. Check out [Formspree](https://formspree.io/) for a simple, free form service. +This is an example of a custom shortcode that you can put right into your content. You will need to add a form action to the the shortcode to make it work. Check out [Formspark](https://formspark.io/) for a simple, free form service. {{< form-contact >}} diff --git a/exampleSite/content/thanks.md b/exampleSite/content/thanks.md new file mode 100644 index 0000000..cf5e6bc --- /dev/null +++ b/exampleSite/content/thanks.md @@ -0,0 +1,9 @@ +--- +title: Thank you +private: true +--- + +Your message will be sent within a short time. +We'll answer as soon as possible. + +[← Back to Home](/). diff --git a/layouts/robots.txt b/layouts/robots.txt index c07f0df..53082b7 100644 --- a/layouts/robots.txt +++ b/layouts/robots.txt @@ -3,6 +3,7 @@ User-agent: * {{- if eq (getenv "HUGO_ENV") "production" | or (eq site.Params.env "production") }} Allow: / +Disallow: /thanks Sitemap: {{ "/stemap.xml" | absURL }} {{- else }} diff --git a/layouts/shortcodes/form-contact.html b/layouts/shortcodes/form-contact.html index d2e0c99..3be7777 100644 --- a/layouts/shortcodes/form-contact.html +++ b/layouts/shortcodes/form-contact.html @@ -1,24 +1,26 @@ {{- /* TODO: Translate me */ -}}
-
+
- +
- +
- +
- - - + + + + +
diff --git a/resources/_gen/assets/scss/sass/style.scss_f300667da4f5b5f84e1a9e0702b2fdde.content b/resources/_gen/assets/scss/sass/style.scss_f300667da4f5b5f84e1a9e0702b2fdde.content index bf3c8c4..1b04769 100644 --- a/resources/_gen/assets/scss/sass/style.scss_f300667da4f5b5f84e1a9e0702b2fdde.content +++ b/resources/_gen/assets/scss/sass/style.scss_f300667da4f5b5f84e1a9e0702b2fdde.content @@ -858,25 +858,30 @@ form input:-moz-ui-invalid { font-size: .78rem; } #page-contact, +#page-thanks, .introduction { min-height: 40px; margin-bottom: 40px; } @media only screen and (min-width: 768px) { #page-contact, + #page-thanks, .introduction { min-height: 60px; margin-bottom: 60px; } } @media only screen and (min-width: 1024px) { #page-contact, + #page-thanks, .introduction { min-height: 80px; margin-bottom: 80px; } } @media only screen and (min-width: 1220px) { #page-contact, + #page-thanks, .introduction { min-height: 100px; margin-bottom: 100px; } } #page-contact .container, +#page-thanks .container, .introduction .container { margin: 10px auto; max-width: 600px; -- cgit v1.2.3