jekyll-theme-amethyst 1.2.0 → 2.0.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: 632ca2202b988416ea82997c0c2fb154ab96c7b806256ee2fd4e0e743a59faaf
4
- data.tar.gz: cccf46ca9b07948abbfee973daba0ddff8fc1203c06ec6e3809109e01b8f39ec
3
+ metadata.gz: 6f24ddb3ef8eea41aefe27157c649ee526fb88508a0500b40a4ae6be5ee2829e
4
+ data.tar.gz: ffede56a7da05fce5c4681135f4e4c11b1e322d8b1fde377849262b0339d71b7
5
5
  SHA512:
6
- metadata.gz: 870a76a617a6e746caf693d670d8a36f9c55de8789f68b4d41b3c7249e3c728aab153987daf0a2df32cbe37355ea1d9b7424099e8b15c50ce304fec00860f657
7
- data.tar.gz: 56eda079a866dcfad9f3eaf8fe8a77592f873d53044a6b6fe535e91dbd9b0a78a8304decc4e4c237cce8f43e5bd4a756f393b014a787e89508a1874241a793d6
6
+ metadata.gz: 9a8681d0da13282f8ac0de2c56cfab79900c90360195f656b244f370145c0bb7c6934839294a7ba363155b60fed34bf60535e6c2e46716ec290e866d3056c2ab
7
+ data.tar.gz: 8eb5fc49da1f95afa1f717ebc65f9c0bf168f9bbded302377ea2ece1ba53b0aba7008a5420cbb68f5922be13427bfc757ce82cff8fc0c4535dd630101cbb2477
@@ -1,5 +1,5 @@
1
- <typesense-minibar>
2
- <form role="search"{% if site.amethyst.typesense.search_only_api_key %} data-origin="{{ site.amethyst.typesense.origin | escape }}" data-collection="{{ site.amethyst.typesense.collection | escape }}" data-key="{{ site.amethyst.typesense.search_only_api_key | escape }}" data-foot="true"{% endif %} action="https://duckduckgo.com">
1
+ <typesense-minibar{% if site.amethyst.typesense.search_only_api_key %} data-origin="{{ site.amethyst.typesense.origin | escape }}" data-collection="{{ site.amethyst.typesense.collection | escape }}" data-key="{{ site.amethyst.typesense.search_only_api_key | escape }}" data-foot="true"{% endif %}>
2
+ <form role="search" action="https://duckduckgo.com">
3
3
  <input type="search" name="q" aria-label="Search" placeholder="Search..." autocomplete="off">
4
4
  <input type="hidden" name="sites" value="{{ site.url | remove_first: 'http://' | remove_first: 'https://' }}">
5
5
  </form>
@@ -0,0 +1,21 @@
1
+ @forward "amethyst-variables";
2
+
3
+ $size-sm: 0.8rem;
4
+ $size-1: 1rem;
5
+ $size-2: 1.333rem;
6
+ $size-3: 1.777rem;
7
+ $size-4: 2.369rem;
8
+ $size-5: 3.157rem;
9
+ $size-spacing: $size-2;
10
+ $box-spacing: $size-1;
11
+
12
+ $color-white: #fff;
13
+ $color-light: #f4f4f4;
14
+ $color-off-white: #cdcdcd;
15
+ $color-darkgrey: #63676d; // based on 2015 api.jquery.com design
16
+ $color-black: #333;
17
+
18
+ $screen-s: 480px;
19
+ $screen-m: 768px;
20
+ $screen-l: 992px;
21
+ $screen-xl: 1200px;
@@ -1,4 +1,5 @@
1
1
  // Amethyst theme variables
2
+ // Override by creating a local `_sass/amethyst-variables.scss` file in your project.
2
3
 
3
4
  // Primary color
4
5
  //
data/_sass/amethyst.scss CHANGED
@@ -2,25 +2,9 @@
2
2
 
3
3
  // Amethyst theme for Jekyll
4
4
 
5
- $size-sm: 0.8rem;
6
- $size-1: 1rem;
7
- $size-2: 1.333rem;
8
- $size-3: 1.777rem;
9
- $size-4: 2.369rem;
10
- $size-5: 3.157rem;
11
- $size-spacing: $size-2;
12
- $box-spacing: $size-1;
13
-
14
- $color-white: #fff;
15
- $color-light: #f4f4f4;
16
- $color-off-white: #cdcdcd;
17
- $color-darkgrey: #63676d; // based on 2015 api.jquery.com design
18
- $color-black: #333;
19
-
20
- $screen-s: 480px;
21
- $screen-m: 768px;
22
- $screen-l: 992px;
23
- $screen-xl: 1200px;
5
+ @use "amethyst-variables-all" as *;
6
+ @use "sass:color";
7
+ @use "sass:string";
24
8
 
25
9
  * {
26
10
  box-sizing: border-box;
@@ -465,13 +449,13 @@ table {
465
449
  /* Search */
466
450
 
467
451
  typesense-minibar {
468
- --tsmb-color-base-background: #{lighten($color-accent, 12%)};
452
+ --tsmb-color-base-background: #{color.adjust($color-accent, $lightness: 12%)};
469
453
  --tsmb-color-primary30: #{$color-accent};
470
454
  --tsmb-color-primary50: #{$color-vibrant};
471
455
  --tsmb-color-primary90: #{$color-bright};
472
456
  --tsmb-color-base30: var(--tsmb-color-primary90);
473
- --tsmb-color-base50: #{change-color($color-bright, $alpha: 0.6)}; // #a98dc1
474
- --tsmb-color-base90: #{change-color($color-bright, $alpha: 0.6)};
457
+ --tsmb-color-base50: #{color.change($color-bright, $alpha: 0.6)}; // #a98dc1
458
+ --tsmb-color-base90: #{color.change($color-bright, $alpha: 0.6)};
475
459
 
476
460
  flex: 1;
477
461
  align-self: center;
@@ -480,7 +464,7 @@ typesense-minibar form {
480
464
  width: auto;
481
465
  }
482
466
  typesense-minibar form:not(:focus-within)::before {
483
- filter: unquote("invert()");
467
+ filter: string.unquote("invert()");
484
468
  }
485
469
  typesense-minibar input[type="search"] {
486
470
  border: none;
@@ -607,8 +591,8 @@ typesense-minibar input[type="search"] {
607
591
 
608
592
  .hero {
609
593
  margin-bottom: $size-spacing;
610
- background-color: darken($color-vibrant, 12%);
611
- background-image: linear-gradient(135deg, darken($color-vibrant, 12%), $color-vibrant );
594
+ background-color: color.adjust($color-vibrant, $lightness: -12%);
595
+ background-image: linear-gradient(135deg, color.adjust($color-vibrant, $lightness: -12%), $color-vibrant );
612
596
  padding: ($size-4 * 2) 0;
613
597
  text-align: center;
614
598
  }
data/_sass/custom.scss CHANGED
@@ -1,2 +1,8 @@
1
1
  // Add custom styles via a local `_sass/custom.scss` file
2
2
  // in your website.
3
+ //
4
+ // To import the same variables as used in amethyst.scss,
5
+ // start your file with this line:
6
+ //
7
+ // @use "amethyst-variables-all" as *;
8
+ //
@@ -1,4 +1,4 @@
1
- /*! https://github.com/jquery/typesense-minibar 1.3.1 */
1
+ /*! https://github.com/jquery/typesense-minibar 1.3.2 */
2
2
  .tsmb-form,
3
3
  typesense-minibar {
4
4
  --tsmb-size-edge: 1px;
@@ -173,12 +173,12 @@ typesense-minibar [role=option] a {
173
173
  }
174
174
 
175
175
  .tsmb-form:not([data-group=true]) [role=option]:not(:first-child) a,
176
- typesense-minibar form:not([data-group=true]) [role=option]:not(:first-child) a {
176
+ typesense-minibar:not([data-group=true]) [role=option]:not(:first-child) a {
177
177
  border-top: var(--tsmb-size-edge) solid var(--tsmb-color-focus90);
178
178
  }
179
179
 
180
180
  .tsmb-form[data-group=true] [role=option] a,
181
- typesense-minibar form[data-group=true] [role=option] a {
181
+ typesense-minibar[data-group=true] [role=option] a {
182
182
  margin: 0 var(--tsmb-size-base);
183
183
  padding: var(--tsmb-size-sm);
184
184
  }
@@ -210,7 +210,8 @@ typesense-minibar [role=option] mark {
210
210
  .tsmb-suggestion_title {
211
211
  color: var(--tsmb-color-primary30);
212
212
  }
213
- .tsmb-form[data-group=true] .tsmb-suggestion_title {
213
+ .tsmb-form[data-group=true] .tsmb-suggestion_title,
214
+ typesense-minibar[data-group=true] .tsmb-suggestion_title {
214
215
  font-weight: bold;
215
216
  font-size: var(--tsmb-size-sm);
216
217
  }
data/assets/styles.scss CHANGED
@@ -3,7 +3,6 @@
3
3
 
4
4
  @use "typesense-minibar.css";
5
5
 
6
- @import "amethyst-variables";
7
- @import "amethyst";
8
- @import "highlight";
9
- @import "custom";
6
+ @use "amethyst";
7
+ @use "highlight";
8
+ @use "custom";
@@ -1,7 +1,5 @@
1
- /*! https://github.com/jquery/typesense-minibar 1.3.1 */
2
- globalThis.tsminibar = function tsminibar (form) {
3
- const { origin, collection } = form.dataset;
4
- const group = !!form.dataset.group;
1
+ /*! https://github.com/jquery/typesense-minibar 1.3.2 */
2
+ globalThis.tsminibar = function tsminibar (form, dataset = form.dataset) {
5
3
  const cache = new Map();
6
4
  const state = { query: '', cursor: -1, open: false, hits: [] };
7
5
  const searchParams = new URLSearchParams({
@@ -14,10 +12,10 @@ globalThis.tsminibar = function tsminibar (form) {
14
12
  sort_by: 'item_priority:desc',
15
13
  snippet_threshold: '8',
16
14
  highlight_affix_num_tokens: '12',
17
- 'x-typesense-api-key': form.dataset.key,
18
- ...Object.fromEntries(new URLSearchParams(form.dataset.searchParams))
15
+ 'x-typesense-api-key': dataset.key,
16
+ ...Object.fromEntries(new URLSearchParams(dataset.searchParams))
19
17
  });
20
- const noResults = form.dataset.noResults || "No results for '{}'.";
18
+ const noResults = dataset.noResults || "No results for '{}'.";
21
19
 
22
20
  const input = form.querySelector('input[type=search]');
23
21
  const listbox = document.createElement('div');
@@ -31,7 +29,7 @@ globalThis.tsminibar = function tsminibar (form) {
31
29
  preconnect = document.createElement('link');
32
30
  preconnect.rel = 'preconnect';
33
31
  preconnect.crossOrigin = 'anonymous'; // match fetch cors,credentials:omit
34
- preconnect.href = origin;
32
+ preconnect.href = dataset.origin;
35
33
  document.head.append(preconnect);
36
34
  }
37
35
  if (!state.open && state.hits.length) {
@@ -92,7 +90,7 @@ globalThis.tsminibar = function tsminibar (form) {
92
90
 
93
91
  function connect () {
94
92
  document.addEventListener('click', onDocClick);
95
- if (form.dataset.slash !== 'false') {
93
+ if (dataset.slash !== 'false') {
96
94
  document.addEventListener('keydown', onDocSlash);
97
95
  form.classList.add('tsmb-form--slash');
98
96
  }
@@ -124,9 +122,10 @@ globalThis.tsminibar = function tsminibar (form) {
124
122
  }
125
123
  searchParams.set('q', query);
126
124
  const resp = await fetch(
127
- `${origin}/collections/${collection}/documents/search?` + searchParams,
125
+ `${dataset.origin}/collections/${dataset.collection}/documents/search?` + searchParams,
128
126
  { mode: 'cors', credentials: 'omit', method: 'GET' }
129
127
  );
128
+ const group = !!dataset.group;
130
129
  const data = await resp.json();
131
130
  hits = data?.grouped_hits?.map(ghit => {
132
131
  const hit = ghit.hits[0];
@@ -151,12 +150,11 @@ globalThis.tsminibar = function tsminibar (form) {
151
150
  function render () {
152
151
  listbox.hidden = !state.open;
153
152
  form.classList.toggle('tsmb-form--open', state.open);
154
- listbox.innerHTML = (state.hits.map((hit, i) => `<div role="option"${i === state.cursor ? ' aria-selected="true"' : ''}>${hit.lvl0 ? `<div class="tsmb-suggestion_group">${hit.lvl0}</div>` : ''}<a href="${hit.url}" tabindex="-1"><div class="tsmb-suggestion_title">${hit.title}</div><div class="tsmb-suggestion_content">${hit.content}</div></a></div>`).join('') || `<div class="tsmb-empty">${noResults.replace('{}', escape(state.query))}</div>`) + (form.dataset.foot ? '<a href="https://typesense.org" class="tsmb-foot" title="Search by Typesense"></a>' : '');
153
+ listbox.innerHTML = (state.hits.map((hit, i) => `<div role="option"${i === state.cursor ? ' aria-selected="true"' : ''}>${hit.lvl0 ? `<div class="tsmb-suggestion_group">${hit.lvl0}</div>` : ''}<a href="${hit.url}" tabindex="-1"><div class="tsmb-suggestion_title">${hit.title}</div><div class="tsmb-suggestion_content">${hit.content}</div></a></div>`).join('') || `<div class="tsmb-empty">${noResults.replace('{}', escape(state.query))}</div>`) + (dataset.foot ? '<a href="https://typesense.org" class="tsmb-foot" title="Search by Typesense"></a>' : '');
155
154
  }
156
155
 
157
156
  function moveCursor (offset) {
158
157
  state.cursor += offset;
159
- // -1 refers to input field
160
158
  if (state.cursor >= state.hits.length) state.cursor = -1;
161
159
  if (state.cursor < -1) state.cursor = state.hits.length - 1;
162
160
  render();
@@ -164,10 +162,10 @@ globalThis.tsminibar = function tsminibar (form) {
164
162
 
165
163
  return { form, connect, disconnect };
166
164
  };
167
- document.querySelectorAll('.tsmb-form[data-origin]').forEach(tsminibar);
168
165
  window.customElements.define('typesense-minibar', class extends HTMLElement {
169
166
  connectedCallback () {
170
167
  const form = this.querySelector('form');
171
- if (form) tsminibar(form);
168
+ if (form && this.dataset.origin) tsminibar(form, this.dataset);
172
169
  }
173
170
  });
171
+ document.querySelectorAll('.tsmb-form[data-origin]').forEach(form => tsminibar(form));
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-theme-amethyst
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timo Tijhof
8
8
  - Trent Willis
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-08-01 00:00:00.000000000 Z
12
+ date: 2025-01-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jekyll
@@ -101,8 +101,8 @@ dependencies:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
103
  version: 2.2.1
104
- description:
105
- email:
104
+ description:
105
+ email:
106
106
  executables: []
107
107
  extensions: []
108
108
  extra_rdoc_files: []
@@ -124,6 +124,7 @@ files:
124
124
  - _layouts/posts-year.html
125
125
  - _layouts/posts.html
126
126
  - _layouts/wrapper.html
127
+ - _sass/amethyst-variables-all.scss
127
128
  - _sass/amethyst-variables.scss
128
129
  - _sass/amethyst.scss
129
130
  - _sass/custom.scss
@@ -137,7 +138,7 @@ licenses:
137
138
  - MIT
138
139
  metadata:
139
140
  plugin_type: theme
140
- post_install_message:
141
+ post_install_message:
141
142
  rdoc_options: []
142
143
  require_paths:
143
144
  - lib
@@ -152,8 +153,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
153
  - !ruby/object:Gem::Version
153
154
  version: '0'
154
155
  requirements: []
155
- rubygems_version: 3.3.5
156
- signing_key:
156
+ rubygems_version: 3.4.20
157
+ signing_key:
157
158
  specification_version: 4
158
159
  summary: https://github.com/qunitjs/jekyll-theme-amethyst
159
160
  test_files: []