type-on-strap 2.3.11 → 2.4.0

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: a37ea279425397cd545055ca109d642aadf5c3f55293a4525458da89b3fdb280
4
- data.tar.gz: '081204be20380cfac5444debfdc2a86c7792e17b7358afcfb594656b212451cc'
3
+ metadata.gz: 8389a7d6ea215d30a665c55a1395631f0fc555772ed192956637b81390cd36d6
4
+ data.tar.gz: 7bb8bef255c863b833801b5c6005c49c33a7c0d9d438f1733b3072685fa3f202
5
5
  SHA512:
6
- metadata.gz: 5a44d150d46b3f7aa736a1c1fd15dfff1e1bb107125249c6577534f847d4bea0213e068268f78340873720aa963f8eab44f2e1d468bd18ac1bd8f1c668b030b1
7
- data.tar.gz: d3991649b3e7138e93c1963e75a89b2502c11398ef670b0c59542dfdf9f3f7c19e0d08a35f25b441554989a82da05e2f604908437ce2f4c4255a14f37cae2fac
6
+ metadata.gz: 3f4da0e9cc2b2447859de17a193b26bede24f02a8f78be88556c44ab4f8cdceac7a57fc101959ebccf5707fb7e3b5a6734548641e4ee359f9be4a0f3bb119e92
7
+ data.tar.gz: 12acd5e8c2b5e807489bbffb5a9472c4488fbacf5af2be3daf396b65231f627d17f82b40df03f0b875e13e6417f3af9fee0f1d631c0d1585ea0e3e9f996744ff
data/README.md CHANGED
@@ -141,12 +141,24 @@ Customize your site header/footer with these variables in `_config.yml`:
141
141
 
142
142
  ```yml
143
143
  header_text: Welcome to my Jekyll blog
144
- header_feature_image: assets/img/sample3.png
145
144
  footer_text: Copyright 2017
146
145
  ```
147
146
 
148
147
  If you don't want anything, replace the value by `" "`.
149
148
 
149
+ #### Header's image
150
+
151
+ The header's image (tested with 2480x1280) can be set as one image with `header_feature_image`
152
+ but can also be responsive:
153
+
154
+ ```yml
155
+ header_feature_image: assets/img/header/my-header-image.png
156
+ header_feature_image_responsive: true
157
+ ```
158
+
159
+ By setting `header_feature_image_responsive` to true, it will look for images
160
+ with suffix `-small` (620x320) and `-medium` (1240x640) to display on smaller screen.
161
+
150
162
  #### Localisation string
151
163
 
152
164
  Localization string is a way to quickly change the template language for text like *Next Post* or *Follow on*, ...
@@ -41,7 +41,7 @@
41
41
  <script defer src="{{ '/assets/js/vendor/auto-render.min.js' | relative_url }}" onload="renderMathInElement(document.body);"></script>
42
42
  {% endif %}
43
43
 
44
- <!-- Mermaid 8.9.2 -->
44
+ <!-- Mermaid 8.13.10 -->
45
45
  {% if site.mermaid %}
46
46
  <script defer src="{{ '/assets/js/vendor/mermaid.min.js' | relative_url }}" onload="mermaid.initialize({startOnLoad:true});"></script>
47
47
  {% endif %}
@@ -1,6 +1,6 @@
1
1
  <!DOCTYPE html>
2
2
  <!--
3
- Type on Strap jekyll theme v2.3.11
3
+ Type on Strap jekyll theme v2.4.0
4
4
  Theme free for personal and commercial use under the MIT license
5
5
  https://github.com/sylhare/Type-on-Strap/blob/master/LICENSE
6
6
  -->
data/_layouts/home.liquid CHANGED
@@ -3,9 +3,25 @@ layout: default
3
3
  ---
4
4
 
5
5
  <div class="home">
6
-
7
- <div id="main" class="call-out"
8
- style="background-image: url('{{ site.header_feature_image | relative_url }}')">
6
+ <style scoped>
7
+ {% assign image = site.header_feature_image | relative_url | split: '.' %}
8
+ .call-out_img {
9
+ background-image: url('{{ image | join: '.' }}');
10
+ }
11
+ {% if site.header_feature_image_responsive %}
12
+ @media screen and (max-width: 768px) {
13
+ .call-out_img {
14
+ background-image: url('{{ image[0] | append: '-medium.' | append: image[1] | default: image}}');
15
+ }
16
+ }
17
+ @media screen and (max-width: 576px) {
18
+ .call-out_img {
19
+ background-image: url('{{ image[0] | append: '-small.' | append: image[1] }}');
20
+ }
21
+ }
22
+ {% endif %}
23
+ </style>
24
+ <div id="main" class="call-out call-out_img">
9
25
  <h1> {{ site.header_text | default: "Change <code>header_text</code> in <code>_config.yml</code>"}} </h1>
10
26
  </div>
11
27
 
@@ -17,20 +17,20 @@
17
17
  }
18
18
 
19
19
  /* --- Responsive --- */
20
- @media screen and (min-width: $break) {
21
- background-size: 120% auto;
20
+ @media screen and (max-width: $m-break) {
21
+ background-size: 170% auto;
22
22
  }
23
23
 
24
- @media screen and (max-width: $break) {
24
+ @media screen and (max-width: 450px) {
25
25
  background-size: 200% auto;
26
26
  }
27
27
 
28
- @media screen and (max-width: $sm-break) {
28
+ @media screen and (max-width: 400px) {
29
29
  background-size: 250% auto;
30
30
  }
31
31
 
32
- @media screen and (max-width: $x-sm-break) {
33
- background-size: 300% auto;
32
+ @media screen and (max-width: 380px) {
33
+ background-size: 280% auto;
34
34
  }
35
35
 
36
36
  p:last-child {
@@ -1 +1 @@
1
- function createCookie(e,t,o){var n,i="";o&&((n=new Date).setTime(n.getTime()+24*o*60*60*1e3),i="; expires="+n.toUTCString()),document.cookie=`${e}=${t}${i}; path=/`}function readCookie(e){for(var t=e+"=",o=document.cookie.split(";"),n=0;n<o.length;n++){for(var i=o[n];" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return i.substring(t.length,i.length)}return null}function addCookieConsentListener(){document.getElementById("cookie-notice-accept").addEventListener("click",function(){createCookie(cookieName,"true",31),document.getElementById("cookie-notice").style.display="none",location.reload()})}function googleAnalytics(){function e(){dataLayer.push(arguments)}""!==analyticsName.toLowerCase()&&(window.dataLayer=window.dataLayer||[],e("js",new Date),e("config",analyticsName),window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)},ga.l=+new Date,ga("create",analyticsName,"auto"),ga("send","pageview"))}"true"===isCookieConsent.toLowerCase()?(addCookieConsentListener(),"true"===readCookie(cookieName)?googleAnalytics():document.getElementById("cookie-notice").style.display="block"):googleAnalytics();const themeButton={light:'<i class="fas fa-adjust" aria-hidden="true"></i>',dark:'<i class="fas fa-adjust fa-rotate-180" aria-hidden="true"></i>'},currentTheme=()=>sessionStorage.getItem("theme");function setMode(e){document.documentElement.setAttribute("data-theme",e),sessionStorage.setItem("theme",e),document.getElementById("theme-toggle").innerHTML=themeButton[e]}function themeToggle(){setMode("light"===currentTheme()?"dark":"light")}window.onload=function(){if(isAutoTheme){if(!currentTheme()){let e=window.matchMedia("(prefers-color-scheme: dark)");e.addEventListener("change",()=>{e.matches&&sessionStorage.setItem("theme","dark")})}var e=currentTheme();setMode(e||"light")}};try{var elem=document.querySelector(".grid"),msnry=new Masonry(elem,{itemSelector:".grid-item",columnWidth:".grid-sizer",gutter:".gutter-sizer",percentPosition:!0}),imgLoad=imagesLoaded(elem);imgLoad.on("progress",function(e,t){msnry.layout()})}catch(e){if(!(e instanceof ReferenceError))throw e}document.addEventListener("DOMContentLoaded",function(e){var t=document.getElementById("pull"),o=document.querySelector("nav ul");["click","touch"].forEach(function(e){t.addEventListener(e,function(){o.classList.toggle("hide")},!1)}),window.addEventListener("scroll",function(){var e=-(window.scrollY||window.pageYOffset||document.body.scrollTop)/3;document.getElementById("main").style.backgroundPosition="100% "+(e-50)+"px, 0%, center top"})});
1
+ function createCookie(e,t,o){var n,i="";o&&((n=new Date).setTime(n.getTime()+24*o*60*60*1e3),i="; expires="+n.toUTCString()),document.cookie=`${e}=${t}${i}; path=/`}function readCookie(e){for(var t=e+"=",o=document.cookie.split(";"),n=0;n<o.length;n++){for(var i=o[n];" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return i.substring(t.length,i.length)}return null}function addCookieConsentListener(){document.getElementById("cookie-notice-accept").addEventListener("click",function(){createCookie(cookieName,"true",31),document.getElementById("cookie-notice").style.display="none",location.reload()})}function googleAnalytics(){function e(){dataLayer.push(arguments)}""!==analyticsName.toLowerCase()&&(window.dataLayer=window.dataLayer||[],e("js",new Date),e("config",analyticsName),window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)},ga.l=+new Date,ga("create",analyticsName,"auto"),ga("send","pageview"))}"true"===isCookieConsent.toLowerCase()?(addCookieConsentListener(),"true"===readCookie(cookieName)?googleAnalytics():document.getElementById("cookie-notice").style.display="block"):googleAnalytics();const themeButton={light:'<i class="fas fa-adjust" aria-hidden="true"></i>',dark:'<i class="fas fa-adjust fa-rotate-180" aria-hidden="true"></i>'},currentTheme=()=>sessionStorage.getItem("theme");function setMode(e){document.documentElement.setAttribute("data-theme",e),sessionStorage.setItem("theme",e),document.getElementById("theme-toggle").innerHTML=themeButton[e]}function themeToggle(){setMode("light"===currentTheme()?"dark":"light")}window.onload=function(){if(isAutoTheme){if(!currentTheme()){let e=window.matchMedia("(prefers-color-scheme: dark)");e.addEventListener("change",()=>{e.matches&&sessionStorage.setItem("theme","dark")})}var e=currentTheme();setMode(e||"light")}};try{var elem=document.querySelector(".grid"),msnry=new Masonry(elem,{itemSelector:".grid-item",columnWidth:".grid-sizer",gutter:".gutter-sizer",percentPosition:!0}),imgLoad=imagesLoaded(elem);imgLoad.on("progress",function(e,t){msnry.layout()})}catch(e){if(!(e instanceof ReferenceError))throw e}document.addEventListener("DOMContentLoaded",function(e){const t=document.getElementById("pull"),o=document.querySelector("nav ul");["click","touch"].forEach(function(e){t.addEventListener(e,function(){o.classList.toggle("hide")},!1)}),window.addEventListener("scroll",function(){var e=-(window.scrollY||window.pageYOffset||document.body.scrollTop)/3;document.getElementById("main").style.backgroundPosition="100% "+(e-50)+"px, 0%, center top"})});
@@ -4,8 +4,8 @@ document.addEventListener("DOMContentLoaded", function (event) {
4
4
  /*
5
5
  * Display the menu items on smaller screens
6
6
  */
7
- var pull = document.getElementById('pull');
8
- var menu = document.querySelector('nav ul');
7
+ const pull = document.getElementById('pull');
8
+ const menu = document.querySelector('nav ul');
9
9
 
10
10
  ['click', 'touch'].forEach(function (e) {
11
11
  pull.addEventListener(e, function () {
@@ -17,7 +17,7 @@ document.addEventListener("DOMContentLoaded", function (event) {
17
17
  * Make the header images move on scroll
18
18
  */
19
19
  window.addEventListener('scroll', function () {
20
- var offset = -(window.scrollY || window.pageYOffset || document.body.scrollTop) / 3;
20
+ const offset = -(window.scrollY || window.pageYOffset || document.body.scrollTop) / 3;
21
21
  document.getElementById("main").style.backgroundPosition = '100% ' + (offset - 50) + 'px' + ', 0%, center top';
22
22
  });
23
23
  });