jekyll-theme-consulting 0.9.10 → 0.10.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 932d49ffa22e1d3d7d193480335d1a4454c4019b9c4b6e06a87e821b68e75093
4
- data.tar.gz: 855a9305e80a249deb69b534496f6266a0f7583a505c388ff1cbe1c5dc8fe72c
3
+ metadata.gz: '0267749ef77dd82f236dd948e2aa7414eeda519ca5c13f54546e06d9933681be'
4
+ data.tar.gz: b84c63d4fef729187874985609a8866131caa3d927fdfdb97677c68f2f5c965c
5
5
  SHA512:
6
- metadata.gz: 20bdc93735275156c2b1039b236863339ffe614478b94801d9a57185e1b1791b826aa063f209030689d7b44fffa39acb45959eeddd8d8e82d6602aaad57df709
7
- data.tar.gz: cc20b071e41e1d54dde82e786fafee7c89d23f76d8cf7e61a028a0de087579828e79e7f9877255341983835cf2d517ecbaed1cfc5611e456b084e6ed50b6a4b6
6
+ metadata.gz: 376739a8d52226d30c647ffe07b3343fb813047493a37c7150ac8c20e5212bcc99282820dc97b01ce701545af31c59e587bb9feca106e76f167219af08f3fd56
7
+ data.tar.gz: 1afd669eb76697a58b947c15a69b2e433600cd1fa088337850fd6cbddac90f841f5bdcfe54bd71c7e4e9673142cd469f2d84ce14aec4e9041fb04883979055de
@@ -27,4 +27,4 @@
27
27
  </div>
28
28
  </section>
29
29
 
30
- {% include contact_script.html form_id=form_id name_input_id=name_input_id email_input_id=email_input_id message_input_id=message_input_id submit_input_id=submit_input_id reset_input_id=reset_input_id recaptcha_widget_id=recaptcha_widget_id onsubmit_callback=onsubmit_callback onreset_callback=onreset_callback onfocusout_callback=onfocusout_callback %}
30
+ {% include contact_client_script.html form_id=form_id name_input_id=name_input_id email_input_id=email_input_id message_input_id=message_input_id submit_input_id=submit_input_id reset_input_id=reset_input_id recaptcha_widget_id=recaptcha_widget_id onsubmit_callback=onsubmit_callback onreset_callback=onreset_callback onfocusout_callback=onfocusout_callback %}
@@ -61,7 +61,7 @@
61
61
  token: grecaptcha.getResponse(recaptchaWidget)
62
62
  };
63
63
 
64
- fetch("{{ '/contact' | absolute_url }}", {
64
+ fetch("{{ '/contact.php' | absolute_url }}", {
65
65
  method: 'POST',
66
66
  mode: 'same-origin',
67
67
  headers: {'Content-Type': 'application/json',},
@@ -0,0 +1,89 @@
1
+ ---
2
+ permalink: /contact.php
3
+ mail:
4
+ subject:
5
+ intro:
6
+ ---
7
+ {%- capture mail-intro -%}You received a message on <a href="{{ site.url }}">your website</a>.{%- endcapture -%}
8
+ <?php
9
+
10
+ $contact_name = $contact_email = $contact_message = $token = $contact_ip = "";
11
+
12
+ if ($_SERVER["REQUEST_METHOD"] == "POST") {
13
+ if (has_required_data($_POST)) {
14
+ $contact_name = filter_var(
15
+ $_POST["name"],
16
+ FILTER_SANITIZE_FULL_SPECIAL_CHARS);
17
+ $contact_email = filter_var(
18
+ $_POST["email"],
19
+ FILTER_SANITIZE_EMAIL);
20
+ $contact_message = filter_var(
21
+ $_POST["message"],
22
+ FILTER_SANITIZE_FULL_SPECIAL_CHARS);
23
+ $token = filter_var(
24
+ $_POST["token"],
25
+ FILTER_SANITIZE_URL);
26
+ if (filter_var(
27
+ $_SERVER['REMOTE_ADDR'],
28
+ FILTER_VALIDATE_IP)) {
29
+ $contact_ip = $_SERVER['REMOTE_ADDR'];
30
+ }
31
+
32
+ if (is_recaptcha_valid($token)) {
33
+ send_mail($contact_name, $contact_email, $contact_message, $contact_ip);
34
+ } else {
35
+ send_mail($contact_name, $contact_email, "Tried to contact you, but his recaptcha is not valid.", $contact_ip);
36
+ }
37
+ }
38
+ }
39
+
40
+ function has_required_data($request) {
41
+ return (
42
+ (
43
+ isset($request['name'])
44
+ && isset($request['email'])
45
+ && isset($request['message'])
46
+ && isset($request['token']))
47
+ && (
48
+ !empty($request['name'])
49
+ && !empty($request['email'])
50
+ && !empty($request['message'])
51
+ && !empty($request['token'])));
52
+ }
53
+
54
+ function is_recaptcha_valid($token) {
55
+ $validation_url = "https://www.google.com/recaptcha/api/siteverify";
56
+ $data = array('secret' => '{{ site.recaptcha.secretkey }}', 'response' => $token);
57
+ $options = array(
58
+ 'http' => array(
59
+ 'header' => "Content-type: application/x-www-form-urlencoded\r\n",
60
+ 'method' => 'POST',
61
+ 'content' => http_build_query($data)));
62
+ $context = stream_context_create($options);
63
+ $result = json_decode(file_get_contents($validation_url, false, $context));
64
+
65
+ return (
66
+ ($result !== FALSE)
67
+ && isset($result->success)
68
+ && $result->success);
69
+ }
70
+
71
+ function send_mail ($name, $email, $message, $ip) {
72
+ return mail(
73
+ "{{ site.email }}",
74
+ "{{ page.mail.subject | default: 'Contact request' }}",
75
+ (
76
+ "{{ page.mail.intro | default: mail-intro }}<br>\r\n"
77
+ ."Ip: ".$ip."<br>\r\n"
78
+ ."Name: ".$name."<br>\r\n"
79
+ ."Email: ".$email."<br>\r\n"
80
+ ."Message: ".$message."<br>\r\n"),
81
+ (
82
+ "From: ".$name
83
+ ." <".$email.">\r\n"
84
+ ."MIME-Version: 1.0\r\n"
85
+ ."Content-type: text/html\r\n"));
86
+ }
87
+
88
+ ?>
89
+
@@ -27,7 +27,7 @@ $font: (
27
27
  family-heading: ('Roboto Slab', serif),
28
28
  family-fixed: ('Courier New', monospace),
29
29
  weight: 400,
30
- weight-bold: 600,
30
+ weight-bold: 900,
31
31
  weight-heading: 700,
32
32
  weight-heading-alt: 400,
33
33
  kerning-heading: 0.075em
@@ -40,7 +40,7 @@ $palette: (
40
40
  bg-inverted: #6666ff,
41
41
  bg-alt-inverted: #223344,
42
42
  fg: #000000,
43
- fg-bold: #3d4449,
43
+ fg-bold: #000000,
44
44
  fg-light: #9fa3a6,
45
45
  fg-inverted: #ffffff,
46
46
  fg-bold-inverted: #ffffff,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-consulting
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.10
4
+ version: 0.10.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Moodule
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-05 00:00:00.000000000 Z
11
+ date: 2020-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -77,8 +77,8 @@ files:
77
77
  - README.md
78
78
  - _includes/banner.html
79
79
  - _includes/contact.html
80
+ - _includes/contact_client_script.html
80
81
  - _includes/contact_form.html
81
- - _includes/contact_script.html
82
82
  - _includes/date.html
83
83
  - _includes/fact.html
84
84
  - _includes/feature.html
@@ -98,6 +98,7 @@ files:
98
98
  - _includes/toggle.html
99
99
  - _includes/waves/bottom.html
100
100
  - _includes/waves/top.html
101
+ - _layouts/contact.html
101
102
  - _layouts/default.html
102
103
  - _layouts/home.html
103
104
  - _layouts/index.html