type-on-strap 2.0.3 → 2.1.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: 909d4360d960728b6976dae7998f9b7f01918238a0ea68a227d49ab0a38a2796
4
- data.tar.gz: 8f5a5364a81b0559482a8093f9f14015e233102959a1a4f1fe744e09d62f3218
3
+ metadata.gz: ef06489094e16d39de802e362adc81b54d3a464458b52c84c02e0ce2b96cb3b4
4
+ data.tar.gz: b66a8e226d91c60fce5fa5ecf4abf7f54b39cfc5acb8234db84d4d1058c5f07b
5
5
  SHA512:
6
- metadata.gz: 6e018b160763e591a46ee24f788c514a08172961c96c3a402f89f9bbc8c0ada741d2c5c395d2c13ea5770178382d0df5a70d9507d9c08712cc1ccd3653cf83b2
7
- data.tar.gz: 3b2645e13b83aac4f1a36a5fafd57d0b0593641b8b0f0382913c95fb5a28bd7912e70c77943f47486709956e8597eb3a4f4b787e9493d5472a248bef36bc60fb
6
+ metadata.gz: dbd593fe75da9e1ccc579b9b33250d7ef176fda853622dd8b6fcf4f8dce15eac6ab8c42096442bda6411552a5f56b592f8408dc85e9b6e943a7397b5b0a8b769
7
+ data.tar.gz: aed10825e1a462a433438b09d0acabdf0e9c013b6720eb5e2ab08a50a1153ee7a862cabdd63b8bbf1441e166de13ea6c578bd979fc2236565eb6843f0f1649b9
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/sylhare/Type-on-Strap.svg?branch=master)](https://travis-ci.org/sylhare/Type-on-Strap)
4
4
  [![Gem Version](https://badge.fury.io/rb/type-on-strap.svg)](https://badge.fury.io/rb/type-on-strap)
5
- [![Docker Pulls](https://img.shields.io/docker/pulls/sylhare/type-on-strap)](https://hub.docker.com/repository/docker/sylhare/type-on-strap)
5
+ [![Docker Pulls](https://img.shields.io/docker/pulls/sylhare/type-on-strap)](https://hub.docker.com/r/sylhare/type-on-strap)
6
6
 
7
7
  A free and open-source [Jekyll](https://jekyllrb.com) theme. Based on Rohan Chandra [type-theme](https://github.com/rohanchandra/type-theme) with a few new features:
8
8
 
@@ -23,13 +23,13 @@ A free and open-source [Jekyll](https://jekyllrb.com) theme. Based on Rohan Chan
23
23
 
24
24
  ## Table of Contents
25
25
 
26
- 1. [Usage](https://github.com/Sylhare/Type-on-Strap#Usage)
27
- 2. [Structure](https://github.com/Sylhare/Type-on-Strap#structure)
28
- 3. [Configure Type on Strap](https://github.com/Sylhare/Type-on-Strap#configure-type-on-strap)
29
- 4. [Other Layouts](https://github.com/Sylhare/Type-on-Strap#other-layouts)
30
- 5. [Feature pages](https://github.com/Sylhare/Type-on-Strap#feature-pages)
31
- 6. [Advanced](https://github.com/Sylhare/Type-on-Strap#advanced)
32
- 7. [License](https://github.com/Sylhare/Type-on-Strap#license)
26
+ - [Usage](#usage)
27
+ - [Structure](#structure)
28
+ - [Configure Type on Strap](#configure-type-on-strap)
29
+ - [Other Layouts](#other-layouts)
30
+ - [Feature pages](#feature-pages)
31
+ - [Advanced](#advanced)
32
+ - [License](#license)
33
33
 
34
34
  ## Usage
35
35
 
@@ -265,6 +265,23 @@ some text in the excerpt
265
265
 
266
266
  The html is stripped out of the excerpt so it only display text.
267
267
 
268
+
269
+ ### Image aligner
270
+
271
+ To easily add align images side by side in your article using the `aligner.html` include:
272
+
273
+ ```ruby
274
+ {% include aligner.html images="path/to/img1.png,path/to/img2.png,path/to/img3.png" column=3 %}
275
+ ```
276
+
277
+ Use it in any markdown file. There are two fields in the include you need to look into:
278
+ - _images_: Takes a string separated with `,` of all the images path.
279
+ - It by default look into `assets/img/` so give the path from there.
280
+ - _column_: (OPTIONAL) Set the number of column you want your imaged displayed in.
281
+ - default is 2 columns
282
+ - `column=3` set 3 columns
283
+ - `column="auto"` makes as many columns as images
284
+
268
285
  ## Other Layouts
269
286
  Please refer to the [Jekyll docs for writing posts](https://jekyllrb.com/docs/posts/).
270
287
  Non-standard features are documented below.
@@ -0,0 +1,15 @@
1
+ {% assign images = include.images | split: ',' %}
2
+
3
+ {% if include.column == "auto" %}
4
+ {% assign column = 100.0 | divided_by: images.size %}
5
+ {% elsif include.column > 0 %}
6
+ {% assign column = 100.0 | divided_by: include.column %}
7
+ {% endif %}
8
+
9
+ <div class="row">
10
+ {% for image in images %}
11
+ <div {% unless column %}class="column"{% endunless%} style="flex: {{ column }}%" >
12
+ <img src="{{ image | prepend: 'assets/img/' | relative_url }}" alt="{{ image | prepend: '/' | split: '/' | last }}">
13
+ </div>
14
+ {% endfor %}
15
+ </div>
@@ -81,6 +81,7 @@
81
81
  &#pull {
82
82
  i {
83
83
  margin-top: 13px;
84
+ margin-right: 10px;
84
85
  float: right;
85
86
  }
86
87
 
@@ -121,7 +122,8 @@
121
122
  overflow: hidden;
122
123
 
123
124
  /* fade out, then shrink */
124
- transition: opacity .5s .25s, font-size .5s .25s;
125
+ transition: opacity .25s 0s, font-size .25s 0s;
126
+ transition-delay: 0s;
125
127
 
126
128
  &.hide {
127
129
  font-size: 0;
@@ -129,24 +131,25 @@
129
131
  opacity: 0;
130
132
  padding: 0;
131
133
  }
134
+ }
132
135
 
133
- li {
134
- width: 100%;
135
- text-align: center;
136
- font-size: 1em;
137
- position: relative;
138
- background-color: darken($background-color, 2%);
136
+ li {
137
+ width: 100%;
138
+ text-align: center;
139
+ font-size: 1em;
140
+ position: relative;
141
+ background-color: darken($background-color, 2%);
139
142
 
140
- &:nth-of-type(4n) {
141
- background-color: $background-color;
142
- }
143
+ &:nth-of-type(4n) {
144
+ background-color: $background-color;
145
+ }
143
146
 
144
- a {
145
- width: 100%;
146
- margin: 0;
147
- display: block;
148
- }
147
+ a {
148
+ width: 100%;
149
+ margin: 0;
150
+ display: block;
149
151
  }
152
+
150
153
  }
151
154
  }
152
155
  }
@@ -9,4 +9,18 @@ h1.title {
9
9
  text-shadow: 1px 1px 2px $text-shadow;
10
10
  }
11
11
 
12
+ .row {
13
+ display: flex;
14
+ flex-wrap: wrap;
15
+ }
16
+
17
+ .column {
18
+ flex: 50%;
19
+
20
+ img {
21
+ width: 100%;
22
+ min-width: 250px;
23
+ }
24
+ }
25
+
12
26
  //Shared css in _post.scss
@@ -1 +1 @@
1
- var elements=document.getElementsByTagName("script");Array.prototype.forEach.call(elements,function(e){if(-1!==e.type.indexOf("math/tex")){var t=e.innerText||e.textContent;t=t.replace(/%.*/g,"");var n=document.createElement("span");-1!==e.type.indexOf("mode=display")?(n.className+="math-display",t="\\displaystyle {"+t+"}"):n.className+="math-inline",katex.render(t,n,{displayMode:!1}),e.parentNode.insertBefore(n,e)}});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"),n=document.querySelector("nav ul");t.addEventListener("click",function(e){n.classList.toggle("hide")}),window.addEventListener("scroll",function(){var e=window.pageYOffset||document.body.scrollTop;document.getElementById("main").style.backgroundPosition="100% "+parseInt(-e/3)+"px, 0%, center top"})});
1
+ var elements=document.getElementsByTagName("script");Array.prototype.forEach.call(elements,function(e){if(-1!==e.type.indexOf("math/tex")){var t=e.innerText||e.textContent;t=t.replace(/%.*/g,"");var n=document.createElement("span");-1!==e.type.indexOf("mode=display")?(n.className+="math-display",t="\\displaystyle {"+t+"}"):n.className+="math-inline",katex.render(t,n,{displayMode:!1}),e.parentNode.insertBefore(n,e)}});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"),n=document.querySelector("nav ul");["click","touch"].forEach(function(e){t.addEventListener(e,function(e){n.classList.toggle("hide")},!1)}),window.addEventListener("scroll",function(){var e=window.pageYOffset||document.body.scrollTop;document.getElementById("main").style.backgroundPosition="100% "+parseInt(-e/3)+"px, 0%, center top"})});
@@ -6,8 +6,11 @@ document.addEventListener("DOMContentLoaded", function (event) {
6
6
  var pull = document.getElementById('pull');
7
7
  var menu = document.querySelector('nav ul');
8
8
 
9
- pull.addEventListener('click', function (e) {
10
- menu.classList.toggle('hide');
9
+
10
+ ['click', 'touch'].forEach(function (e) {
11
+ pull.addEventListener(e, function (e) {
12
+ menu.classList.toggle('hide')
13
+ }, false);
11
14
  });
12
15
 
13
16
  /*
@@ -20,4 +23,4 @@ document.addEventListener("DOMContentLoaded", function (event) {
20
23
 
21
24
  mainStyle.backgroundPosition = '100% ' + parseInt(-x / 3) + 'px' + ', 0%, center top';
22
25
  });
23
- });
26
+ });
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: type-on-strap
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sylhare
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-01-31 00:00:00.000000000 Z
12
+ date: 2020-03-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jekyll
@@ -87,6 +87,7 @@ files:
87
87
  - LICENSE
88
88
  - README.md
89
89
  - _data/language.yml
90
+ - _includes/aligner.html
90
91
  - _includes/blog.html
91
92
  - _includes/blog_nav.html
92
93
  - _includes/disqus.html
@@ -267,7 +268,7 @@ post_install_message: |
267
268
 
268
269
  * Use _data/ for social and language customization
269
270
 
270
- * Vist https://github.com/sylhare/Type-on-Strap for more info.
271
+ * Visit https://github.com/sylhare/Type-on-Strap for more info.
271
272
 
272
273
  -------------------------------------------------------------------------------------
273
274
  rdoc_options: