jekyll-theme-consulting 0.9.9 → 0.10.3

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: ec076e819aa8e8ffcd09e88a5d12c25e62b23bd7742650a24ac0c341c527708b
4
- data.tar.gz: 7ac44e419c66dc8ffe31cb8bb304bb824096fd90064bc5fa750b68eefd69c4b6
3
+ metadata.gz: cf4b346828d9745cd0d92091c845db875f04036618372d32d58c29e025422ad9
4
+ data.tar.gz: 411b6948e3a4c218b4a579dd8c8376722ebf51a330fdbb2add99a2947001c54d
5
5
  SHA512:
6
- metadata.gz: 9aca2ba593bada25b4437fde6cdcc7bbc34b697c08b09bcf6dc136bba8e3e6156bb69a9e885b9e357c41bbf241600e07f14ab1cfbb56f30791cf1b2f803a5695
7
- data.tar.gz: fc8ffe53e4412ab14128a64047e267a85beecc30a43ff676146860bb1ac954975b4605723bf2f28704393b7e6c1219048fa685f8e7966e0bbfb4cc9a4aeb068d
6
+ metadata.gz: a475fcc6994e78e1fd36047ffa70c4640ca5f8f179f0520ffa441ef7a21fcb037f88574517788bacd3f1a52aa1f35055a81aa86dc3fb43ba475a42fe9250c293
7
+ data.tar.gz: e702de5b269e20bd6d0150c3df6e449aba94a3a328b68af822bf0278e5e3e6b85436d819a76977e195c011a68fd75f37ec62dce32acb90be8466967d1c070e7d
@@ -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',},
@@ -11,7 +11,7 @@
11
11
  <label for="option-{{ tab-id }}" style="width: {{ include.header-width | default: 30 }}%;">{{ tab.title }}</label>
12
12
  <section class="tab-panel" style="left: {{ include.header-width | default: 30 }}%;">
13
13
  {% if show-title == true %}<h2>{{ tab.title }}</h2>{% endif %}
14
- <p>{{ tab.content }}</p>
14
+ {{ tab.content }}
15
15
  </section>
16
16
  </div>
17
17
  {%- endfor -%}
@@ -0,0 +1,80 @@
1
+ ---
2
+ permalink: /contact.php
3
+ subject: Contact request
4
+ ---
5
+ <?php
6
+
7
+ $name = $email = $message = $token = $ip = "";
8
+
9
+ if ($_SERVER["REQUEST_METHOD"] == "POST") {
10
+ if (has_required_data($_POST)) {
11
+ $name = filter_var(
12
+ $_POST["name"],
13
+ FILTER_SANITIZE_FULL_SPECIAL_CHARS);
14
+ $email = filter_var(
15
+ $_POST["email"],
16
+ FILTER_SANITIZE_EMAIL);
17
+ $message = filter_var(
18
+ $_POST["message"],
19
+ FILTER_SANITIZE_FULL_SPECIAL_CHARS);
20
+ $token = filter_var(
21
+ $_POST["token"],
22
+ FILTER_SANITIZE_URL);
23
+ if (filter_var(
24
+ $_SERVER['REMOTE_ADDR'],
25
+ FILTER_VALIDATE_IP)) {
26
+ $ip = $_SERVER['REMOTE_ADDR'];
27
+ }
28
+
29
+ if (is_recaptcha_valid($token)) {
30
+ send_mail($name, $email, $message);
31
+ } else {
32
+ send_mail($name, $email, "Got a fishy request from ".$ip);
33
+ }
34
+ }
35
+ }
36
+
37
+ function has_required_data($request) {
38
+ return (
39
+ (
40
+ isset($request['name'])
41
+ && isset($request['email'])
42
+ && isset($request['message'])
43
+ && isset($request['token']))
44
+ && (
45
+ !empty($request['name'])
46
+ && !empty($request['email'])
47
+ && !empty($request['message'])
48
+ && !empty($request['token']))
49
+ );
50
+ }
51
+
52
+ function is_recaptcha_valid($token) {
53
+ $validation_url = "https://www.google.com/recaptcha/api/siteverify";
54
+ $data = array('secret' => '{{ site.recaptcha.secretkey }}', 'response' => $token);
55
+ $options = array(
56
+ 'http' => array(
57
+ 'header' => "Content-type: application/x-www-form-urlencoded\r\n",
58
+ 'method' => 'POST',
59
+ 'content' => http_build_query($data)
60
+ )
61
+ );
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) {
72
+ return mail(
73
+ "{{ site.email }}",
74
+ "{{ page.subject | default: 'Contact request' }}",
75
+ $message."\r\n\nFrom: ".$name." @ ".$ip,
76
+ "From: ".$name." <".$email.">\r\nMIME-Version: 1.0\r\nContent-type: text/html\r\n");
77
+ }
78
+
79
+ ?>
80
+
@@ -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.9
4
+ version: 0.10.3
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-04 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