type-on-strap 2.4.11 → 2.4.12
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 +4 -4
- data/LICENSE +1 -1
- data/README.md +25 -19
- data/_layouts/default.html +1 -1
- data/_layouts/search.liquid +1 -1
- data/_sass/includes/_navbar.scss +2 -3
- data/assets/js/vendor/simple-jekyll-search.min.js +4 -3
- metadata +3 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '075180d85d8b3f726379b120cda867ef006c58038108a1eb5d5e8d6bd964552f'
|
4
|
+
data.tar.gz: cbebd901837f8c486e86e0e1375d1c70e9f2c106fbf12502bfae7b40209c1ae6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ab3635eb48b4b914f8a01213f8097151d03efe64fd97508b756e316652ecdde7ad26513e9881890f106ab30a764925e924b6a5d93bd2e08e3a58cb31bab129b
|
7
|
+
data.tar.gz: f4b7a95179014c900312f9b2deb46a3201cf207742204893c68833f549fbd9cf1c31ece6fc56d3e163a6faa5a1eb577b0fd26cd90afc4d521c6b08fd534d5bad
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -14,7 +14,7 @@ Based on Rohan Chandra [type-theme](https://github.com/rohanchandra/type-theme)
|
|
14
14
|
* Multi comments 💬 options
|
15
15
|
* Tags compatibility 🏷
|
16
16
|
* Handle _Bootstrap_'ed pages: [Get Bootstrap](http://getbootstrap.com/)
|
17
|
-
* 🔎 Search feature: [Simple-Jekyll-Search](https://github.com/
|
17
|
+
* 🔎 Search feature: [Simple-Jekyll-Search](https://github.com/sylhare/Simple-Jekyll-Search)
|
18
18
|
* Math Rendering : [KateX](https://github.com/Khan/KaTeX)
|
19
19
|
* Diagram Rendering: [Mermaid-js](https://github.com/mermaid-js/mermaid)
|
20
20
|
* 🖋 Nice fonts: [Font Awesome](https://fontawesome.com/), [Source Sans Pro](https://fonts.google.com/specimen/Source+Sans+Pro), [Pacifico](https://fonts.google.com/specimen/Pacifico?selection.family=Pacifico)
|
@@ -27,13 +27,7 @@ Based on Rohan Chandra [type-theme](https://github.com/rohanchandra/type-theme)
|
|
27
27
|
|
28
28
|
## Usage
|
29
29
|
|
30
|
-
### As a
|
31
|
-
|
32
|
-
Check out this tutorial: [Use as Ruby Gem](#use-as-ruby-gem-)
|
33
|
-
|
34
|
-
[](https://gitpod.io/#/https://github.com/sylhare/Type-On-Strap)
|
35
|
-
|
36
|
-
### As a github page 📋
|
30
|
+
### As a GitHub page 📋
|
37
31
|
|
38
32
|
1. Fork and clone the [Type on Strap repo](https://github.com/sylhare/Type-On-Strap): `git clone https://github.com/Sylhare/Type-on-Strap.git`
|
39
33
|
2. Install [Jekyll](https://jekyllrb.com/docs/installation/): `gem install jekyll`, check [#1](https://github.com/Sylhare/Type-on-Strap/issues/1) if you have a problem.
|
@@ -42,6 +36,12 @@ Check out this tutorial: [Use as Ruby Gem](#use-as-ruby-gem-)
|
|
42
36
|
- GitHub Page: [update `_config.yml`](#site-configuration)
|
43
37
|
5. Run the Jekyll server: `bundle exec jekyll serve`
|
44
38
|
|
39
|
+
### As a ruby gem 💎
|
40
|
+
|
41
|
+
Check out this tutorial: [Use as Ruby Gem](#use-as-ruby-gem-)
|
42
|
+
|
43
|
+
[](https://gitpod.io/#/https://github.com/sylhare/Type-On-Strap)
|
44
|
+
|
45
45
|
## Structure
|
46
46
|
|
47
47
|
Here are the main files of the template
|
@@ -165,9 +165,10 @@ with suffix `-small` (620x320) and `-medium` (1240x640) to display on smaller sc
|
|
165
165
|
Localization string is a way to quickly change the template language for text like *Next Post* or *Follow on*, ...
|
166
166
|
You can find all the properties in `_data/language.yml`.
|
167
167
|
|
168
|
-
By default, it is in English, but you can
|
168
|
+
By default, it is in English, but you can add your own language.
|
169
169
|
|
170
|
-
Here you also can set the date format, e.g., set `str_date_format: '%B %-d, %Y'` for "January, 13, 2024",
|
170
|
+
Here you also can set the date format, e.g., set `str_date_format: '%B %-d, %Y'` for "January, 13, 2024",
|
171
|
+
`str_date_format: '%Y-%m-%d'` for 2024-01-13, or `str_date_format: '%d.%m.%Y'` for 13.01.2024.
|
171
172
|
|
172
173
|
### Google Analytics
|
173
174
|
|
@@ -295,7 +296,8 @@ Display icons in the footer.
|
|
295
296
|
All icon variables should be your username enclosed in quotes (e.g. "username") in `_data/icons.yml`.
|
296
297
|
|
297
298
|
You can update the RSS settings in `_data/social` to change the default feed path (generated by [jekyll-feel](https://github.com/jekyll/jekyll-feed)).
|
298
|
-
To enable the share icons at the bottom of each article
|
299
|
+
To enable the share icons at the bottom of each article,
|
300
|
+
set to true the one you'd like under `share` in the `_data/social.yml` file.
|
299
301
|
|
300
302
|
### Personalize your Blog Posts 📝
|
301
303
|
|
@@ -318,7 +320,7 @@ title: Hello World # Title of the page
|
|
318
320
|
hide_title: true # [Opt] Hide the title when displaying the post, but shown in lists of posts
|
319
321
|
feature-img: "assets/img/sample.png" # [Opt] Add a feature-image to the post
|
320
322
|
thumbnail: "assets/img/thumbnails/sample-th.png" # [Opt] Add a thumbnail image on blog view
|
321
|
-
color: rgb(80,140,22) # [Opt] Add the specified
|
323
|
+
color: rgb(80,140,22) # [Opt] Add the specified color as feature image and links in post
|
322
324
|
position: 1 # [Opt] Set position on the menu navigation bar
|
323
325
|
tags: [sample, markdown, html] # [Opt] Add tags to the page
|
324
326
|
---
|
@@ -339,7 +341,7 @@ It will respect the page and theme layout, mind the padding on the sides.
|
|
339
341
|
|
340
342
|
#### Post excerpt
|
341
343
|
|
342
|
-
The [excerpt](https://jekyllrb.com/docs/posts/#post-excerpts)
|
344
|
+
The [excerpt](https://jekyllrb.com/docs/posts/#post-excerpts) is the head of the article rendered in the blog page.
|
343
345
|
The length of the excerpt has a default of around `250` characters or can be manually set in the post using:
|
344
346
|
|
345
347
|
in `conflig.yml`:
|
@@ -369,8 +371,12 @@ The html is stripped out of the excerpt, so it only displays text.
|
|
369
371
|
|
370
372
|
To easily add align images side by side in your article using the `aligner.html` include:
|
371
373
|
|
372
|
-
```
|
373
|
-
{% include aligner.html
|
374
|
+
```liquid
|
375
|
+
{% include aligner.html
|
376
|
+
images="path/to/img1.png,path/to/img2.png,path/to/img3.png"
|
377
|
+
column=3
|
378
|
+
caption="some description"
|
379
|
+
%}
|
374
380
|
```
|
375
381
|
|
376
382
|
Use it in any markdown file. There are two fields in the _include_ you need to look into:
|
@@ -501,7 +507,7 @@ gallery: "assets/img/pexels"
|
|
501
507
|
|
502
508
|
### Feature: Search 🔍
|
503
509
|
|
504
|
-
The search feature is based on [Simple-Jekyll-search](https://github.com/
|
510
|
+
The search feature is based on [Simple-Jekyll-search](https://github.com/sylhare/Simple-Jekyll-Search)
|
505
511
|
there is a `search.liquid` file that will create a list of all the site posts, pages and portfolios.
|
506
512
|
Then there's a script displaying the formatted results in the _search page_.
|
507
513
|
|
@@ -546,7 +552,7 @@ The Tag page can be hidden with the `hide` option. You can remove the icon by re
|
|
546
552
|
|
547
553
|
Jekyll works with [liquid](https://shopify.github.io/liquid/) tags usually represented by:
|
548
554
|
|
549
|
-
```
|
555
|
+
```liquid
|
550
556
|
{{ liquid.tag | filter }}
|
551
557
|
```
|
552
558
|
|
@@ -606,7 +612,7 @@ You can use Type-on-strap as a [gem](https://rubygems.org/gems/type-on-strap).
|
|
606
612
|
Using the [Ruby Gem Method](https://sylhare.github.io/2021/03/25/Run-type-on-strap-jekyll-theme-locally.html).
|
607
613
|
Add this line to your Jekyll site's Gemfile (or create one):
|
608
614
|
|
609
|
-
```
|
615
|
+
```shell
|
610
616
|
gem "type-on-strap"
|
611
617
|
```
|
612
618
|
|
@@ -618,7 +624,7 @@ theme: type-on-strap
|
|
618
624
|
|
619
625
|
Then run Bundler to install the theme gem and dependencies:
|
620
626
|
|
621
|
-
```
|
627
|
+
```shell
|
622
628
|
bundle install
|
623
629
|
```
|
624
630
|
|
data/_layouts/default.html
CHANGED
data/_layouts/search.liquid
CHANGED
@@ -17,7 +17,7 @@ layout: page
|
|
17
17
|
searchResultTemplate: '<div class="search-title"><a href="{url}"><h3> {title}</h3></a><div class="meta">{date} <div class="right"><i class="fas fa-tag"></i> {tags}</div></div><p>{excerpt}</p></div><hr> ',
|
18
18
|
noResultsText: '{{ site.data.language.str_no_result_found | default: "No result found" }}',
|
19
19
|
limit: 10,
|
20
|
-
|
20
|
+
strategy: 'wildcard',
|
21
21
|
exclude: []
|
22
22
|
})
|
23
23
|
</script>
|
data/_sass/includes/_navbar.scss
CHANGED
@@ -90,7 +90,7 @@ nav {
|
|
90
90
|
|
91
91
|
/* ---- Responsive ---- */
|
92
92
|
|
93
|
-
@media (min-width: $break) {
|
93
|
+
@media (min-width: $break + 1) {
|
94
94
|
a#pull {
|
95
95
|
display: none;
|
96
96
|
}
|
@@ -138,7 +138,7 @@ nav {
|
|
138
138
|
width: 100%;
|
139
139
|
text-align: center;
|
140
140
|
font-size: 1em;
|
141
|
-
|
141
|
+
margin: 0;
|
142
142
|
background-color: var(--background);
|
143
143
|
backdrop-filter: brightness(0.98);
|
144
144
|
|
@@ -148,7 +148,6 @@ nav {
|
|
148
148
|
|
149
149
|
a {
|
150
150
|
width: 100%;
|
151
|
-
margin: 0;
|
152
151
|
display: block;
|
153
152
|
}
|
154
153
|
|
@@ -1,6 +1,7 @@
|
|
1
1
|
/*!
|
2
|
-
* Simple-Jekyll-Search
|
3
|
-
* Copyright 2015-
|
2
|
+
* Simple-Jekyll-Search v1.15.1
|
3
|
+
* Copyright 2015-2022, Christian Fei
|
4
|
+
* Copyright 2025-2025, Sylhare
|
4
5
|
* Licensed under the MIT License.
|
5
6
|
*/
|
6
|
-
|
7
|
+
(function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?factory(exports):typeof define==="function"&&define.amd?define(["exports"],factory):(global=typeof globalThis!=="undefined"?globalThis:global||self,factory(global.SimpleJekyllSearch={}))})(this,(function(exports2){"use strict";function load(location,callback){const xhr=getXHR();xhr.open("GET",location,true);xhr.onreadystatechange=createStateChangeListener(xhr,callback);xhr.send()}function createStateChangeListener(xhr,callback){return function(){if(xhr.readyState===4&&xhr.status===200){try{callback(null,JSON.parse(xhr.responseText))}catch(err){callback(err instanceof Error?err:new Error(String(err)),null)}}}}function getXHR(){return window.XMLHttpRequest?new window.XMLHttpRequest:new window.ActiveXObject("Microsoft.XMLHTTP")}class OptionsValidator{constructor(params){if(!this.validateParams(params)){throw new Error("-- OptionsValidator: required options missing")}this.requiredOptions=params.required}getRequiredOptions(){return this.requiredOptions}validate(parameters){const errors=[];this.requiredOptions.forEach((requiredOptionName=>{if(typeof parameters[requiredOptionName]==="undefined"){errors.push(requiredOptionName)}}));return errors}validateParams(params){if(!params){return false}return typeof params.required!=="undefined"&&Array.isArray(params.required)}}function fuzzySearch(text,pattern){pattern=pattern.trimEnd();if(pattern.length===0)return true;pattern=pattern.toLowerCase();text=text.toLowerCase();let remainingText=text,currentIndex=-1;for(const char of pattern){const nextIndex=remainingText.indexOf(char);if(nextIndex===-1||currentIndex!==-1&&remainingText.slice(0,nextIndex).split(" ").length-1>2){return false}currentIndex=nextIndex;remainingText=remainingText.slice(nextIndex+1)}return true}function literalSearch(text,criteria){text=text.trim().toLowerCase();const pattern=criteria.endsWith(" ")?[criteria.toLowerCase()]:criteria.trim().toLowerCase().split(" ");return pattern.filter((word=>text.indexOf(word)>=0)).length===pattern.length}function levenshtein(a,b){const lenA=a.length;const lenB=b.length;const distanceMatrix=Array.from({length:lenA+1},(()=>Array(lenB+1).fill(0)));for(let i=0;i<=lenA;i++)distanceMatrix[i][0]=i;for(let j=0;j<=lenB;j++)distanceMatrix[0][j]=j;for(let i=1;i<=lenA;i++){for(let j=1;j<=lenB;j++){const cost=a[i-1]===b[j-1]?0:1;distanceMatrix[i][j]=Math.min(distanceMatrix[i-1][j]+1,distanceMatrix[i][j-1]+1,distanceMatrix[i-1][j-1]+cost)}}return distanceMatrix[lenA][lenB]}function levenshteinSearch(text,pattern){const distance=levenshtein(pattern,text);const similarity=1-distance/Math.max(pattern.length,text.length);return similarity>=.3}function wildcardSearch(text,pattern){const regexPattern=pattern.replace(/\*/g,".*");const regex=new RegExp(`^${regexPattern}$`,"i");if(regex.test(text))return true;return levenshteinSearch(text,pattern)}class SearchStrategy{constructor(matchFunction){this.matchFunction=matchFunction}matches(text,criteria){if(text===null||text.trim()===""||!criteria){return false}return this.matchFunction(text,criteria)}}const LiteralSearchStrategy=new SearchStrategy(literalSearch);const FuzzySearchStrategy=new SearchStrategy(((text,criteria)=>fuzzySearch(text,criteria)||literalSearch(text,criteria)));const WildcardSearchStrategy=new SearchStrategy(((text,criteria)=>wildcardSearch(text,criteria)||literalSearch(text,criteria)));function merge(target,source){return{...target,...source}}function isJSON(json){try{return!!(json instanceof Object&&JSON.parse(JSON.stringify(json)))}catch(_err){return false}}function NoSort(){return 0}function isObject(obj){return Boolean(obj)&&Object.prototype.toString.call(obj)==="[object Object]"}function clone(input){if(input===null||typeof input!=="object"){return input}if(Array.isArray(input)){return input.map((item=>clone(item)))}const output={};for(const key in input){if(Object.prototype.hasOwnProperty.call(input,key)){output[key]=clone(input[key])}}return output}const DEFAULT_OPTIONS={searchInput:null,resultsContainer:null,json:[],success:function(){},searchResultTemplate:'<li><a href="{url}" title="{desc}">{title}</a></li>',templateMiddleware:(_prop,_value,_template)=>void 0,sortMiddleware:NoSort,noResultsText:"No results found",limit:10,fuzzy:false,strategy:"literal",debounceTime:null,exclude:[],onSearch:()=>{}};const REQUIRED_OPTIONS=["searchInput","resultsContainer","json"];const WHITELISTED_KEYS=new Set(["Enter","Shift","CapsLock","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","Meta"]);class Repository{constructor(initialOptions={}){this.data=[];this.setOptions(initialOptions)}put(input){if(isObject(input)){return this.addObject(input)}if(Array.isArray(input)){return this.addArray(input)}return void 0}clear(){this.data.length=0;return this.data}search(criteria){if(!criteria){return[]}return clone(this.findMatches(this.data,criteria).sort(this.options.sortMiddleware))}setOptions(newOptions){this.options={fuzzy:(newOptions==null?void 0:newOptions.fuzzy)||DEFAULT_OPTIONS.fuzzy,limit:(newOptions==null?void 0:newOptions.limit)||DEFAULT_OPTIONS.limit,searchStrategy:this.searchStrategy((newOptions==null?void 0:newOptions.strategy)||newOptions.fuzzy&&"fuzzy"||DEFAULT_OPTIONS.strategy),sortMiddleware:(newOptions==null?void 0:newOptions.sortMiddleware)||DEFAULT_OPTIONS.sortMiddleware,exclude:(newOptions==null?void 0:newOptions.exclude)||DEFAULT_OPTIONS.exclude,strategy:(newOptions==null?void 0:newOptions.strategy)||DEFAULT_OPTIONS.strategy}}addObject(obj){this.data.push(obj);return this.data}addArray(arr){const added=[];this.clear();for(const item of arr){if(isObject(item)){added.push(this.addObject(item)[0])}}return added}findMatches(data,criteria){const matches=[];for(let i=0;i<data.length&&matches.length<this.options.limit;i++){const match=this.findMatchesInObject(data[i],criteria);if(match){matches.push(match)}}return matches}findMatchesInObject(obj,criteria){for(const key in obj){if(!this.isExcluded(obj[key])&&this.options.searchStrategy.matches(obj[key],criteria)){return obj}}return void 0}isExcluded(term){for(const excludedTerm of this.options.exclude){if(new RegExp(excludedTerm).test(String(term))){return true}}return false}searchStrategy(strategy){switch(strategy){case"fuzzy":return FuzzySearchStrategy;case"wildcard":return WildcardSearchStrategy;default:return LiteralSearchStrategy}}}const options={pattern:/\{(.*?)\}/g,template:"",middleware:function(){return void 0}};function setOptions(_options){if(_options.pattern){options.pattern=_options.pattern}if(_options.template){options.template=_options.template}if(typeof _options.middleware==="function"){options.middleware=_options.middleware}}function compile(data){return options.template.replace(options.pattern,(function(match,prop){const value=options.middleware(prop,data[prop],options.template);if(typeof value!=="undefined"){return value}return data[prop]||match}))}let SimpleJekyllSearch$1=class SimpleJekyllSearch{constructor(){this.debounceTimerHandle=null;this.options={...DEFAULT_OPTIONS};this.repository=new Repository;this.optionsValidator=new OptionsValidator({required:REQUIRED_OPTIONS})}debounce(func,delayMillis){if(delayMillis){if(this.debounceTimerHandle){clearTimeout(this.debounceTimerHandle)}this.debounceTimerHandle=setTimeout(func,delayMillis)}else{func()}}throwError(message){throw new Error(`SimpleJekyllSearch --- ${message}`)}emptyResultsContainer(){this.options.resultsContainer.innerHTML=""}initWithJSON(json){this.repository.put(json);this.registerInput()}initWithURL(url){load(url,((err,json)=>{if(err){this.throwError(`Failed to load JSON from ${url}: ${err.message}`)}this.initWithJSON(json)}))}registerInput(){this.options.searchInput.addEventListener("input",(e=>{const inputEvent=e;if(!WHITELISTED_KEYS.has(inputEvent.key)){this.emptyResultsContainer();this.debounce((()=>{this.search(e.target.value)}),this.options.debounceTime??null)}}))}search(query){var _a,_b;if((query==null?void 0:query.trim().length)>0){this.emptyResultsContainer();const results=this.repository.search(query);this.render(results,query);(_b=(_a=this.options).onSearch)==null?void 0:_b.call(_a)}}render(results,query){if(results.length===0){this.options.resultsContainer.insertAdjacentHTML("beforeend",this.options.noResultsText);return}const fragment=document.createDocumentFragment();results.forEach((result=>{result.query=query;const div=document.createElement("div");div.innerHTML=compile(result);fragment.appendChild(div)}));this.options.resultsContainer.appendChild(fragment)}init(_options){var _a;const errors=this.optionsValidator.validate(_options);if(errors.length>0){this.throwError(`Missing required options: ${REQUIRED_OPTIONS.join(", ")}`)}this.options=merge(this.options,_options);setOptions({template:this.options.searchResultTemplate,middleware:this.options.templateMiddleware});this.repository.setOptions({fuzzy:this.options.fuzzy,limit:this.options.limit,sortMiddleware:this.options.sortMiddleware,strategy:this.options.strategy,exclude:this.options.exclude});if(isJSON(this.options.json)){this.initWithJSON(this.options.json)}else{this.initWithURL(this.options.json)}const rv={search:this.search.bind(this)};(_a=this.options.success)==null?void 0:_a.call(rv);return rv}};function SimpleJekyllSearch(options2){const instance=new SimpleJekyllSearch$1;return instance.init(options2)}if(typeof window!=="undefined"){window.SimpleJekyllSearch=SimpleJekyllSearch}exports2.default=SimpleJekyllSearch;Object.defineProperties(exports2,{__esModule:{value:true},[Symbol.toStringTag]:{value:"Module"}})}));
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: type-on-strap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylhare
|
8
8
|
- Rohan Chandra
|
9
|
-
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2025-05-05 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: jekyll
|
@@ -293,8 +292,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
293
292
|
- !ruby/object:Gem::Version
|
294
293
|
version: '0'
|
295
294
|
requirements: []
|
296
|
-
rubygems_version: 3.
|
297
|
-
signing_key:
|
295
|
+
rubygems_version: 3.6.2
|
298
296
|
specification_version: 4
|
299
297
|
summary: A simple and responsive jekyll theme template
|
300
298
|
test_files: []
|