jekyll-theme-twenty 0.1.8 → 0.1.9

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: e2e026667745552d4d6decb894c1f72ec96da94e7ac5ecd1c5dedb6c1912c8a5
4
- data.tar.gz: 489a058edd5ab20e5b3875d10f58124402cede1ba62f45211fff365ebb16c23a
3
+ metadata.gz: 6c13da77845cd2ec6ff57e1fde4ec6c1bca8f289eff86532c665f7e167874de7
4
+ data.tar.gz: 42f3f8761c2fb794fd9f483cb1080feb0a3145dd7ec33917c7217a9a80b34870
5
5
  SHA512:
6
- metadata.gz: 677225b9bd4a6a83b0654eaf8d74c752c44ece3b2cc7fbfd662e99dfd886d0f44fcdd3210e84b73f08de2c7e537368024fb9e16ee5f1a0864acaf2b860bedb80
7
- data.tar.gz: f83b2ccabaae921737cac48ce3421771bae74990a67766477439dd5f3457e80bacc572c65339814de48f4307ee5da466edb76d99183219229f1f28a026ec733d
6
+ metadata.gz: cb064195d6340cb710480d343105cac27f4156b184ce87635cc708c50861a0c11625227b8aa4e91dc51dcdb755f3235a6e19f92c4bff3f75ddc0496ea81baa27
7
+ data.tar.gz: 7bd7687ef8d16d01025632811d3e7021d7c90f29069823c84315e1abf2d0022f42e53cbd49525018a5fcbbc807007f4b79166a371ef87539ed24191013dac834
data/README.md CHANGED
@@ -22,6 +22,10 @@ You can preview the theme [here](https://moodule.github.io/jekyll-theme-twenty).
22
22
 
23
23
  > **SEO ready**: sitemap, robots.txt and tags are automatically generated for the website
24
24
 
25
+ > **Light**: svg images, thumbs and lazy loading for raster images, few libraries
26
+
27
+ > **Hardened**: form validation, recaptcha, verified libraries
28
+
25
29
  # Installation
26
30
 
27
31
  Add this line to your Jekyll site's `Gemfile`:
@@ -50,21 +54,35 @@ For those unfamiliar with how Jekyll works, check out [jekyllrb.com](https://jek
50
54
  or read up on just the basics of [front matter](https://jekyllrb.com/docs/frontmatter/), [writing posts](https://jekyllrb.com/docs/posts/),
51
55
  and [creating pages](https://jekyllrb.com/docs/pages/).
52
56
 
57
+ ## Initialization
58
+
59
+ Copy the file `_config.yml` from the theme repository to the root of your website folder tree.
60
+ The following section explains what the settings impact and how to configure `_config.yml` properly.
61
+
53
62
  ## Configuration
54
63
 
55
64
  You can use the following custom parameters in `_config.yml`.
56
65
 
57
66
  ### Site
67
+
58
68
  Both `title` and `subtitle` are displayed side by side :
59
69
  - in the tab name
60
70
  - at the top of the page, in the header
61
71
 
62
72
  ### Social
73
+
63
74
  Social icons will appear for each url your fill in, among `facebook_url` etc.
64
75
 
65
76
  ### Contact
77
+
66
78
  Your contact information can be used in contact forms, the footer or anywhere else.
67
79
 
80
+ ### Recaptcha
81
+
82
+ The contact form is validated using [google's recaptcha plugin][recaptcha-documentation].
83
+ First, you need to [sign your website up] to enable the plugin.
84
+ Google will provide you with a **client-side integration key**: copy it to `_config.yml` under `recaptcha.sitekey`.
85
+
68
86
  ## Publication
69
87
 
70
88
  ### On Github Pages
@@ -194,3 +212,5 @@ The theme is available as open source under the terms of the [CC-BY-3.0](LICENSE
194
212
  [cookieconsent]: https://github.com/osano/cookieconsent
195
213
  [html5up]: https://html5up.net/
196
214
  [jekyll-logo]: https://github.com/jekyll/brand
215
+ [recaptcha-documentation]: https://developers.google.com/recaptcha/intro
216
+ [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' }}" 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>
@@ -10,5 +10,4 @@
10
10
  </a>
11
11
  </h1>
12
12
  {% include navigation.html menu=include.menu %}
13
- {% include language.html %}
14
13
  </header>
@@ -1,11 +1,9 @@
1
1
  {%- assign posts=site.posts | where:"lang-ref", page.lang-ref | sort: 'lang' -%}
2
2
  {%- assign pages=site.pages | where:"lang-ref", page.lang-ref | sort: 'lang' | concat: posts -%}
3
- <ul class="language">
4
- {%- for page in pages -%}
5
- {%- if page.lang != "x-default" -%}
6
- <li>
7
- <a href="{{ page.url | absolute_url }}" class="{{ page.lang }}">{{ page.lang }}</a>
8
- </li>
9
- {%- endif -%}
10
- {%- endfor -%}
11
- </ul>
3
+ {%- for page in pages -%}
4
+ {%- if page.lang != "x-default" -%}
5
+ <li>
6
+ <a href="{{ page.url | absolute_url }}" class="{{ page.lang }}">{{ page.lang }}</a>
7
+ </li>
8
+ {%- endif -%}
9
+ {%- endfor -%}
@@ -17,5 +17,6 @@
17
17
  </li>
18
18
  {%- endif -%}
19
19
  {%- endfor -%}
20
+ {% include language.html %}
20
21
  </ul>
21
22
  </nav>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-twenty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
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