jekyll-theme-consulting 0.9.7 → 0.10.1

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: f616d7ba3326e0bc9931e4b6cc3eb571f35780aae5d813aef0d41e2208aa6def
4
- data.tar.gz: 87ef0cc53528ac8392e8b88ac19f2256b33f478603baf7422770fb5cfd788f54
3
+ metadata.gz: 17ca15a34984ff88be827b0e3669dd7f8edcb5b94699a9eff382b513e1ff0a84
4
+ data.tar.gz: 56f338f8a0af42f63a87687790791fca07666a5aa96e65c5ab4a5e25554ddbbc
5
5
  SHA512:
6
- metadata.gz: 20fc851e5f2eac14c79d9941e20c6f9943864c74cd75677bda40dfa897f0b8e4337f8398ddcaac759b7df08920cf321a1fe64a103020efbfbba2d896aacbf55f
7
- data.tar.gz: 10ed173db443e472828f5df8957a94de0a8051e49223662b87af11da83329056153a76e8c0b805983e6dc3c7776b7532f7b7f4525c461d71b3b1e8066420a035
6
+ metadata.gz: b92a7b6ff45e3809d5a7cbab7e279a4f5f017a0386a7ea7afd073b4eac41d2238a6bdfbf803d721d2ae8bb35c5cfeaffee5e82c942b03240506fb0c6359015f9
7
+ data.tar.gz: c4ec1fc7bdcb7e8619d542f5f97f24b1ae1d4ae6a117b87db24764c73dbe8451f23f87526f58e870b94f41f330a8f5155a8b9ce9b75661c7e833c3f8ba481ca7
@@ -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',},
@@ -7,9 +7,9 @@
7
7
  <link rel="stylesheet" href="{{ 'assets/css/large.css' | absolute_url }}" media="screen and (min-width: 981px)" />
8
8
  <link rel="stylesheet" href="{{ 'assets/css/medium.css' | absolute_url }}" media="screen and (min-width: 737px) and (max-width:980px)" />
9
9
  <link rel="stylesheet" href="{{ 'assets/css/small.css' | absolute_url }}" media="screen and (max-width:736px)" />
10
- <link rel="preload" href="https://fonts.googleapis.com/css?family=Open+Sans:400,600,400italic,600italic|Roboto+Slab:400,700&display=swap" as="style" onload="this.onload=null;this.rel='stylesheet';this.media='all'">
11
- <link rel="preload" href="{{ 'assets/css/fontawesome-all.min.css' | absolute_url }}" as="style" onload="this.onload=null;this.rel='stylesheet';this.media='all'">
12
- <link rel="preload" href="{{ 'assets/css/cookieconsent.min.css' | absolute_url }}" as="style" onload="this.onload=null;this.rel='stylesheet';this.media='all'">
10
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:400,600,400italic,600italic|Roboto+Slab:400,700&display=swap" type="text/css" media="all">
11
+ <link rel="stylesheet" href="{{ 'assets/css/fontawesome-all.min.css' | absolute_url }}" type="text/css" media="all">
12
+ <link rel="stylesheet" href="{{ 'assets/css/cookieconsent.min.css' | absolute_url }}" type="text/css" media="all">
13
13
  {%- if include.stylesheets -%}
14
14
  {%- for file in include.stylesheets -%}
15
15
  <link rel="stylesheet" href="{{ file.url | absolute_url }}" />
@@ -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 -%}
@@ -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,
@@ -0,0 +1,78 @@
1
+ ---
2
+ layout: null
3
+ ---
4
+ <?php
5
+
6
+ $name = $email = $message = $token = $ip = "";
7
+
8
+ if ($_SERVER["REQUEST_METHOD"] == "POST") {
9
+ if (has_required_data($_POST)) {
10
+ $name = filter_var(
11
+ $_POST["name"],
12
+ FILTER_SANITIZE_FULL_SPECIAL_CHARS);
13
+ $email = filter_var(
14
+ $_POST["email"],
15
+ FILTER_SANITIZE_EMAIL);
16
+ $message = filter_var(
17
+ $_POST["message"],
18
+ FILTER_SANITIZE_FULL_SPECIAL_CHARS);
19
+ $token = filter_var(
20
+ $_POST["token"],
21
+ FILTER_SANITIZE_URL);
22
+ if (filter_var(
23
+ $_SERVER['REMOTE_ADDR'],
24
+ FILTER_VALIDATE_IP)) {
25
+ $ip = $_SERVER['REMOTE_ADDR'];
26
+ }
27
+
28
+ if is_recaptcha_valid($token) {
29
+ send_mail($name, $email, $message);
30
+ } else {
31
+ send_mail($name, $email, "Got a fishy request from ".$ip)
32
+ }
33
+ }
34
+ }
35
+
36
+ function has_required_data($request) {
37
+ return (
38
+ (
39
+ isset($request['name'])
40
+ && isset($request['email'])
41
+ && isset($request['message'])
42
+ && isset($request['token']))
43
+ && (
44
+ !empty($request['name'])
45
+ && !empty($request['email'])
46
+ && !empty($request['message'])
47
+ && !empty($request['token']))
48
+ );
49
+ }
50
+
51
+ function is_recaptcha_valid($token) {
52
+ $validation_url = "https://www.google.com/recaptcha/api/siteverify";
53
+ $data = array('secret' => '{{ site.recaptcha.secretkey }}', 'response' => $token);
54
+ $options = array(
55
+ 'http' => array(
56
+ 'header' => "Content-type: application/x-www-form-urlencoded\r\n",
57
+ 'method' => 'POST',
58
+ 'content' => http_build_query($data)
59
+ )
60
+ );
61
+ $context = stream_context_create($options);
62
+ $result = json_decode(file_get_contents($validation_url, false, $context));
63
+
64
+ return (
65
+ ($result !== FALSE)
66
+ && isset($result->success)
67
+ && $result->success);
68
+ }
69
+
70
+ function send_mail ($name, $email, $message) {
71
+ return mail(
72
+ "{{ site.email }}",
73
+ "{{ site.subject | default: 'Contact request' }}",
74
+ $message."\r\n\nFrom: ".$name." @ ".$ip,
75
+ "From: ".$name." <".$email.">\r\nMIME-Version: 1.0\r\nContent-type: text/html\r\n");
76
+ }
77
+
78
+ ?>
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.7
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Moodule
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-31 00:00:00.000000000 Z
11
+ date: 2020-08-07 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
@@ -279,6 +279,7 @@ files:
279
279
  - assets/webfonts/fa-solid-900.ttf
280
280
  - assets/webfonts/fa-solid-900.woff
281
281
  - assets/webfonts/fa-solid-900.woff2
282
+ - contact.php
282
283
  homepage: https://github.com/moodule/jekyll-theme-consulting
283
284
  licenses:
284
285
  - CC-BY-NC-SA-4.0