jekyll-theme-parallelism 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc26032a32351effd706cd10bfebf2b2510da8fe8937ccb35c94aa3051754117
4
- data.tar.gz: 22c9f447d3f21c235b816a4a1d7e00a5e11ca900f6c1dd7dd39a893c1108eedf
3
+ metadata.gz: c69e6fed0e29bab85dd26690df92e08711db7ddac1f227e63b442da9676d8cad
4
+ data.tar.gz: 43e9c51ac9348b61a9b0312b236abf2f102642ede55085b8d4427db27c8fb6e7
5
5
  SHA512:
6
- metadata.gz: 4f774e1a0303a11e55e97bb9e75b81581dc1504b912f7e723e665c97adf6557c6a4cc8efd0d218acabffed333623cd36a67888681692db3e25a1d136c66a0586
7
- data.tar.gz: 770e4efd310766ed1687bd73d939797cf2234b99db176c1583b9fd1fe3a4e773037b7b6077dd8878a6acfd56a8e16101a636407355cbbca8d85d0e10008eec39
6
+ metadata.gz: 3d057c4265ef03e2b89fbdaa579f013b7210df54abf4a7ae16d03a08e04f1701965b40f8b5969bd80491edc15c8ad339652a1408972bef1b94c62bfd15b1fc41
7
+ data.tar.gz: 4951e5b7cfbe2ada0e05846e69ee440bea24ffd8c4a11bbbca93281c248379e984e4f90591f54ad902a964b12730b49acc18c2e18bbcd99eb4fd04c2c3b84c1c
data/README.md CHANGED
@@ -20,6 +20,10 @@ You can preview the theme [here](https://moodule.github.io/jekyll-theme-parallel
20
20
 
21
21
  > **SEO ready**: sitemap, robots.txt and tags are automatically generated for the website
22
22
 
23
+ > **Light**: svg images, thumbs and lazy loading for raster images, few libraries
24
+
25
+ > **Hardened**: form validation, recaptcha, verified libraries
26
+
23
27
  # Installation
24
28
 
25
29
  Add this line to your Jekyll site's `Gemfile`:
@@ -48,21 +52,35 @@ For those unfamiliar with how Jekyll works, check out [jekyllrb.com](https://jek
48
52
  or read up on just the basics of [front matter](https://jekyllrb.com/docs/frontmatter/), [writing posts](https://jekyllrb.com/docs/posts/),
49
53
  and [creating pages](https://jekyllrb.com/docs/pages/).
50
54
 
55
+ ## Initialization
56
+
57
+ Copy the file `_config.yml` from the theme repository to the root of your website folder tree.
58
+ The following section explains what the settings impact and how to configure `_config.yml` properly.
59
+
51
60
  ## Configuration
52
61
 
53
62
  You can use the following custom parameters in `_config.yml`.
54
63
 
55
64
  ### Site
65
+
56
66
  Both `title` and `subtitle` are displayed side by side :
57
67
  - in the tab name
58
68
  - at the top of the page, in the header
59
69
 
60
70
  ### Social
71
+
61
72
  Social icons will appear for each url your fill in, among `facebook_url` etc.
62
73
 
63
74
  ### Contact
75
+
64
76
  Your contact information can be used in contact forms, the footer or anywhere else.
65
77
 
78
+ ### Recaptcha
79
+
80
+ The contact form is validated using [google's recaptcha plugin][recaptcha-documentation].
81
+ First, you need to [sign your website up] to enable the plugin.
82
+ Google will provide you with a **client-side integration key**: copy it to `_config.yml` under `recaptcha.sitekey`.
83
+
66
84
  ## Publication
67
85
 
68
86
  ### On Github Pages
@@ -196,3 +214,5 @@ The theme is available as open source under the terms of the [CC-BY-3.0](LICENSE
196
214
  [cookieconsent]: https://github.com/osano/cookieconsent
197
215
  [html5up]: https://html5up.net/
198
216
  [jekyll-logo]: https://github.com/jekyll/brand
217
+ [recaptcha-documentation]: https://developers.google.com/recaptcha/intro
218
+ [recaptcha-registering]: https://www.google.com/recaptcha/admin
@@ -0,0 +1,13 @@
1
+ {%- assign form_id="contact-form" -%}
2
+ {%- assign name_input_id="contact-name" -%}
3
+ {%- assign email_input_id="contact-email" -%}
4
+ {%- assign message_input_id="contact-message" -%}
5
+ {%- assign submit_input_id="contact-submit-button" -%}
6
+ {%- assign reset_input_id="contact-reset-button" -%}
7
+ {%- assign recaptcha_widget_id="recaptcha-checkbox" -%}
8
+ {%- assign onsubmit_callback="sendContactMessage" -%}
9
+ {%- assign onreset_callback="resetContactForm" -%}
10
+
11
+ {% include contact_form.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 %}
12
+
13
+ {% 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 %}
@@ -0,0 +1,25 @@
1
+ <form id="{{ include.form_id | 'contact-form' }}" method="post" action="#" onsubmit="{{ include.onsubmit_callback | 'sendContactMessage' }}()" onreset="{{ include.onreset_callback | 'resetContactForm' }}()" >
2
+ <div class="row gtr-50">
3
+ <div class="col-6 col-12-mobile required">
4
+ <input type="text" name="{{ include.name_input_id | 'contact-name' }}" id="{{ include.name_input_id | 'contact-name' }}" placeholder="Name" required minlength="4" maxlength="64" />
5
+ </div>
6
+ <div class="col-6 col-12-mobile required">
7
+ <input type="email" name="{{ include.email_input_id | 'contact-email' }}" id="{{ include.email_input_id | 'contact-email' }}" placeholder="Email" required minlength="8" maxlength="64" />
8
+ </div>
9
+ <div class="col-12 required">
10
+ <select name="contact-subject" id="contact-subject" >
11
+ <option value="0">Choose a subject</option>
12
+ </select>
13
+ </div>
14
+ <div class="col-12 required">
15
+ <textarea name="{{ include.message_input_id | 'contact-message' }}" id="{{ include.message_input_id | 'contact-message' }}" placeholder="Message" rows="7" required minlength="16" maxlength="256" ></textarea>
16
+ </div>
17
+ <div class="col-12">
18
+ <ul class="buttons">
19
+ <li><div id="{{ include.recaptcha_widget_id | 'recaptcha-checkbox' }}" ></div></li>
20
+ <li><input type="submit" id="{{ include.submit_input_id | 'contact-submit-button' }}" class="special" value="Send Message" disabled /></li>
21
+ <li><input type="reset" id="{{ include.reset_input_id | 'contact-reset-button' }}" class="special" value="Reset" /></li>
22
+ </ul>
23
+ </div>
24
+ </div>
25
+ </form>
@@ -0,0 +1,51 @@
1
+ <script type="text/javascript">
2
+ const contactFormElement = document.getElementById("{{ include.form_id | default: 'contact-form' }}");
3
+ const nameInputElement = document.getElementById("{{ include.name_input_id | default: 'contact-name' }}");
4
+ const emailInputElement = document.getElementById("{{ include.email_input_id | default: 'contact-email' }}");
5
+ const messageInputElement = document.getElementById("{{ include.message_input_id | default: 'contact-message' }}");
6
+ const submitInputElement = document.getElementById("{{ include.submit_input_id | default: 'contact-submit-button' }}");
7
+ var recaptchaWidget;
8
+
9
+ const isInputValid = function() {
10
+ return (nameInputElement.checkValidity()
11
+ && emailInputElement.checkValidity()
12
+ && messageInputElement.checkValidity())
13
+ };
14
+
15
+ const isRecaptchaValid = function() {
16
+ var responseToken = grecaptcha.getResponse(recaptchaWidget);
17
+ return true;
18
+ };
19
+
20
+ const disableSubmitInputElement = function (disabled = true) {
21
+ submitInputElement.disabled = disabled;
22
+ }
23
+
24
+ const {{ include.onreset_callback | 'resetContactForm' }} = function() {
25
+ contactFormElement.reset();
26
+ disableSubmitInputElement();
27
+ };
28
+
29
+ const {{ include.onsubmit_callback | 'sendContactMessage()' }} = function() {
30
+ encodeURIComponent(nameInputElement.value);
31
+ encodeURIComponent(emailInputElement.value);
32
+ encodeURIComponent(messageInputElement.value);
33
+ };
34
+
35
+ var onloadCallback = function() {
36
+ var verifyForm = function(response) {
37
+ if (isInputValid() && isRecaptchaValid()) {
38
+ disableSubmitInputElement(false);
39
+ } else {
40
+ disableSubmitInputElement();
41
+ }
42
+ };
43
+ recaptchaWidget = grecaptcha.render('{{ include.recaptcha_widget_id | 'recaptcha-checkbox' }}', {
44
+ 'sitekey' : '{{ site.recaptcha.sitekey }}',
45
+ 'theme' : 'dark',
46
+ 'callback' : verifyForm,
47
+ 'expired-callback': disableSubmitInputElement
48
+ });
49
+ };
50
+ </script>
51
+ <script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit" async defer></script>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-parallelism
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Mougeolle
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-02 00:00:00.000000000 Z
11
+ date: 2019-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -62,6 +62,9 @@ files:
62
62
  - LICENSE
63
63
  - README.md
64
64
  - _includes/banner.html
65
+ - _includes/contact.html
66
+ - _includes/contact_form.html
67
+ - _includes/contact_script.html
65
68
  - _includes/cta.html
66
69
  - _includes/date.html
67
70
  - _includes/footer.html