jekyll-theme-consulting 0.9.6 → 0.10.0

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: de22123c10abd0205d8d98d71de73c15ed425b3d74d7cf96e3eca0b271ebfe8e
4
- data.tar.gz: d16923104d6a2fc93028ccb96071897e41534b3723e86046ecbed2db37c4e20d
3
+ metadata.gz: 606108f5aa0396efdd45e7c86cb130e6b2e178f877b427c620572206b412c60d
4
+ data.tar.gz: ddfdf3ae14502e3b2d99b9fe685686e5596da4ca2125bdd6967845631a546f35
5
5
  SHA512:
6
- metadata.gz: 49dbba420c4350bdd76d4856634f3f311ec74ec2d39bf08bc138c7f51e3588fe8f3a292da33cb6a059f6265c9568d793305818e27f233f557513f4aaa11558b8
7
- data.tar.gz: 05566a7c46ec219cc9df849fa4bac5a861a023c42ab6b83a2e8e3f9615b80bb1c7b38372dec72d39ce286a7c84d867c5706e1123d81f8207d89ec96f17e8b3c1
6
+ metadata.gz: f31332096f41bdfc8f23ee87c00b55886b8cb777f7482efc052540dfd2197aad1e2302da2d4680155d57f86b5dc3c4938a61f6cbce0a2f1613bd67f0b1c701fa
7
+ data.tar.gz: 5223040f1b057537680fca1b9875f19f5d507a55f38c11a124741d451b4841fc409276b575c59ee5585ad001a65238c4b3a1765c06fb5fc4c6f055ae0358af55
@@ -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,70 @@
1
+ <?php
2
+
3
+ $name = $email = $message = $token = "";
4
+
5
+ if ($_SERVER["REQUEST_METHOD"] == "POST") {
6
+ if (has_required_data($_POST)) {
7
+ $name = filter_var(
8
+ $_POST["name"],
9
+ FILTER_SANITIZE_FULL_SPECIAL_CHARS);
10
+ $email = filter_var(
11
+ $_POST["email"],
12
+ FILTER_SANITIZE_EMAIL);
13
+ $message = filter_var(
14
+ $_POST["message"],
15
+ FILTER_SANITIZE_FULL_SPECIAL_CHARS);
16
+ $token = filter_var(
17
+ $_POST["token"],
18
+ FILTER_SANITIZE_URL);
19
+
20
+ if is_recaptcha_valid($token) {
21
+ send_mail($name, $email, $message);
22
+ } else {
23
+ send_mail($name, $email, "Is fishy.")
24
+ }
25
+ }
26
+ }
27
+
28
+ function has_required_data($request) {
29
+ return (
30
+ (
31
+ isset($request['name'])
32
+ && isset($request['email'])
33
+ && isset($request['message'])
34
+ && isset($request['token']))
35
+ && (
36
+ !empty($request['name'])
37
+ && !empty($request['email'])
38
+ && !empty($request['message'])
39
+ && !empty($request['token']))
40
+ );
41
+ }
42
+
43
+ function is_recaptcha_valid($token) {
44
+ $validation_url = "https://www.google.com/recaptcha/api/siteverify";
45
+ $data = array('secret' => '{{ site.recaptcha.secretkey }}', 'response' => $token);
46
+ $options = array(
47
+ 'http' => array(
48
+ 'header' => "Content-type: application/x-www-form-urlencoded\r\n",
49
+ 'method' => 'POST',
50
+ 'content' => http_build_query($data)
51
+ )
52
+ );
53
+ $context = stream_context_create($options);
54
+ $result = json_decode(file_get_contents($validation_url, false, $context));
55
+
56
+ return (
57
+ ($result !== FALSE)
58
+ && isset($result->success)
59
+ && $result->success);
60
+ }
61
+
62
+ function send_mail ($name, $email, $message) {
63
+ return mail(
64
+ "{{ site.email }}",
65
+ "{{ include.subject | default: 'Contact request' }}",
66
+ $message,
67
+ "From: ".$name." <".$email.">\r\nMIME-Version: 1.0\r\nContent-type: text/html\r\n");
68
+ }
69
+
70
+ ?>
@@ -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,
@@ -55,7 +55,7 @@
55
55
  }
56
56
 
57
57
  .horizontal-tabset .tab-panels .tab-panel {
58
- padding: 30px 0;
58
+ padding: 30px 0 !important;
59
59
  border-top: 2px solid _palette(accent);
60
60
  }
61
61
 
@@ -62,7 +62,7 @@
62
62
  position: absolute;
63
63
  top: 0;
64
64
  left: 40%;
65
- padding: 0 30px;
65
+ padding: 0 30px !important;
66
66
  margin: 0 0 0 -2px;
67
67
  border-left: 2px solid _palette(accent);
68
68
  height: 100%;
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.6
4
+ version: 0.10.0
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,9 @@ 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
+ - _includes/contact_server_script.php
82
83
  - _includes/date.html
83
84
  - _includes/fact.html
84
85
  - _includes/feature.html