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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e78a035f75b739da30f8d85764b32dd39d1f4dc7f997a8850578b5f565a49de
4
- data.tar.gz: 34b98e73a1859f98bfc6f713eda44a326eabb14ac07a3473dcfcc73caef8f96d
3
+ metadata.gz: '075180d85d8b3f726379b120cda867ef006c58038108a1eb5d5e8d6bd964552f'
4
+ data.tar.gz: cbebd901837f8c486e86e0e1375d1c70e9f2c106fbf12502bfae7b40209c1ae6
5
5
  SHA512:
6
- metadata.gz: c289a6c37850430dd2b56ba97680bc01994d1ebb47df511293e850fe3d2a82b42bc5ed8783e83083f4a5e7bf4cc1cdb5df4349223d57767f0ab87506f657f79d
7
- data.tar.gz: a8a520edf5c37d366895764367e5d729831db537810ebbd6a4db11d1bb5310f4be676b708ad2ef159e656afc506cc560954809253ab56bbf4d414a095560c7e0
6
+ metadata.gz: 0ab3635eb48b4b914f8a01213f8097151d03efe64fd97508b756e316652ecdde7ad26513e9881890f106ab30a764925e924b6a5d93bd2e08e3a58cb31bab129b
7
+ data.tar.gz: f4b7a95179014c900312f9b2deb46a3201cf207742204893c68833f549fbd9cf1c31ece6fc56d3e163a6faa5a1eb577b0fd26cd90afc4d521c6b08fd534d5bad
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2016-2024 Sylhare
3
+ Copyright (c) 2016-2025 Sylhare
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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/christian-fei/Simple-Jekyll-Search)
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 ruby gem 💎
31
-
32
- Check out this tutorial: [Use as Ruby Gem](#use-as-ruby-gem-)
33
-
34
- [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](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
+ [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](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 easily add your own language.
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", `str_date_format: '%Y-%m-%d'` for 2024-01-13, or `str_date_format: '%d.%m.%Y'` for 13.01.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 set to true the one you'd like under `share` in the `_data/social.yml` file.
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 colour as feature image, and change link colors in post
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) are the first lines of an article that is displayed on the blog page.
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
- ```ruby
373
- {% include aligner.html images="path/to/img1.png,path/to/img2.png,path/to/img3.png" column=3 %}
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/christian-fei/Simple-Jekyll-Search)
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
- ```ruby
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
- ```bash
627
+ ```shell
622
628
  bundle install
623
629
  ```
624
630
 
@@ -1,6 +1,6 @@
1
1
  <!DOCTYPE html>
2
2
  <!--
3
- Type on Strap jekyll theme v2.4.11
3
+ Type on Strap jekyll theme v2.4.12
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
  -->
@@ -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
- fuzzy: false,
20
+ strategy: 'wildcard',
21
21
  exclude: []
22
22
  })
23
23
  </script>
@@ -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
- position: relative;
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 1.10.0
3
- * Copyright 2015-2020, Christian Fei
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
- !function(){"use strict";var f={compile:function(r){return i.template.replace(i.pattern,function(t,e){var n=i.middleware(e,r[e],i.template);return void 0!==n?n:r[e]||t})},setOptions:function(t){i.pattern=t.pattern||i.pattern,i.template=t.template||i.template,"function"==typeof t.middleware&&(i.middleware=t.middleware)}};const i={pattern:/\{(.*?)\}/g,template:"",middleware:function(){}};var n=function(t,e){var n=e.length,r=t.length;if(n<r)return!1;if(r===n)return t===e;t:for(var i=0,o=0;i<r;i++){for(var u=t.charCodeAt(i);o<n;)if(e.charCodeAt(o++)===u)continue t;return!1}return!0},e=new function(){this.matches=function(t,e){return n(e.toLowerCase(),t.toLowerCase())}},r=new function(){this.matches=function(e,t){return!!e&&(e=e.trim().toLowerCase(),(t=t.trim().toLowerCase()).split(" ").filter(function(t){return 0<=e.indexOf(t)}).length===t.split(" ").length)}},d={put:function(t){if(l(t))return a(t);if(function(t){return Boolean(t)&&"[object Array]"===Object.prototype.toString.call(t)}(t))return function(n){const r=[];s();for(let t=0,e=n.length;t<e;t++)l(n[t])&&r.push(a(n[t]));return r}(t);return undefined},clear:s,search:function(t){return t?function(e,n,r,i){const o=[];for(let t=0;t<e.length&&o.length<i.limit;t++){var u=function(t,e,n,r){for(const i in t)if(!function(n,r){for(let t=0,e=r.length;t<e;t++){var i=r[t];if(new RegExp(i).test(n))return!0}return!1}(t[i],r.exclude)&&n.matches(t[i],e))return t}(e[t],n,r,i);u&&o.push(u)}return o}(u,t,c.searchStrategy,c).sort(c.sort):[]},setOptions:function(t){c=t||{},c.fuzzy=t.fuzzy||!1,c.limit=t.limit||10,c.searchStrategy=t.fuzzy?e:r,c.sort=t.sort||o,c.exclude=t.exclude||[]}};function o(){return 0}const u=[];let c={};function s(){return u.length=0,u}function l(t){return Boolean(t)&&"[object Object]"===Object.prototype.toString.call(t)}function a(t){return u.push(t),u}c.fuzzy=!1,c.limit=10,c.searchStrategy=c.fuzzy?e:r,c.sort=o,c.exclude=[];var p={load:function(t,e){const n=window.XMLHttpRequest?new window.XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");n.open("GET",t,!0),n.onreadystatechange=h(n,e),n.send()}};function h(e,n){return function(){if(4===e.readyState&&200===e.status)try{n(null,JSON.parse(e.responseText))}catch(t){n(t,null)}}}var m=function y(t){if(!(e=t)||!("undefined"!=typeof e.required&&e.required instanceof Array))throw new Error("-- OptionsValidator: required options missing");var e;if(!(this instanceof y))return new y(t);const r=t.required;this.getRequiredOptions=function(){return r},this.validate=function(e){const n=[];return r.forEach(function(t){"undefined"==typeof e[t]&&n.push(t)}),n}},w={merge:function(t,e){const n={};for(const r in t)n[r]=t[r],"undefined"!=typeof e[r]&&(n[r]=e[r]);return n},isJSON:function(t){try{return t instanceof Object&&JSON.parse(JSON.stringify(t))?!0:!1}catch(e){return!1}}};!function(t){let i={searchInput:null,resultsContainer:null,json:[],success:Function.prototype,searchResultTemplate:'<li><a href="{url}" title="{desc}">{title}</a></li>',templateMiddleware:Function.prototype,sortMiddleware:function(){return 0},noResultsText:"No results found",limit:10,fuzzy:!1,debounceTime:null,exclude:[]},n;const e=function(t,e){e?(clearTimeout(n),n=setTimeout(t,e)):t.call()};var r=["searchInput","resultsContainer","json"];const o=m({required:r});function u(t){d.put(t),i.searchInput.addEventListener("input",function(t){-1===[13,16,20,37,38,39,40,91].indexOf(t.which)&&(c(),e(function(){l(t.target.value)},i.debounceTime))})}function c(){i.resultsContainer.innerHTML=""}function s(t){i.resultsContainer.innerHTML+=t}function l(t){var e;(e=t)&&0<e.length&&(c(),function(e,n){var r=e.length;if(0===r)return s(i.noResultsText);for(let t=0;t<r;t++)e[t].query=n,s(f.compile(e[t]))}(d.search(t),t))}function a(t){throw new Error("SimpleJekyllSearch --- "+t)}t.SimpleJekyllSearch=function(t){var n;0<o.validate(t).length&&a("You must specify the following required options: "+r),i=w.merge(i,t),f.setOptions({template:i.searchResultTemplate,middleware:i.templateMiddleware}),d.setOptions({fuzzy:i.fuzzy,limit:i.limit,sort:i.sortMiddleware,exclude:i.exclude}),w.isJSON(i.json)?u(i.json):(n=i.json,p.load(n,function(t,e){t&&a("failed to get JSON ("+n+")"),u(e)}));t={search:l};return"function"==typeof i.success&&i.success.call(t),t}}(window)}();
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.11
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: 2024-11-28 00:00:00.000000000 Z
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.3.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: []