bridgetown-quick-search 1.0.4 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d296a4401d3d3be406aa8f81a86b1ca4bcf87fb26304618873e5f541e84485ba
4
- data.tar.gz: ba97513856b7d144d7562ab6306d6aace720f5b81944de7148a2f2d68bd416f8
3
+ metadata.gz: 768480c9d41d98c78703497a4008b763b26f69eb8430bd6ad0553921adae97c3
4
+ data.tar.gz: ab6c066d1eba6fc352d4c44c1ae68dc8bba0051df767e2323ea225e1d218e2c9
5
5
  SHA512:
6
- metadata.gz: eec66212424bc3c1bf4aa6608b736f49cbcf87843316d56eb27ecf9190ba9a2dddbbe6e731e51d7693f96494176f2f5c4cb11d7d54ca10a874a52094fda89849
7
- data.tar.gz: 0ff627baaba5516ddb178d80396094e4ad8fcb693323876be53d11dc1cf5348d00bc2dc77072e8722b86b8f7c1ada98db810f57ffd55486ea38739cc984a4c2b
6
+ metadata.gz: 2e00a482fef880762507b7239a17b91e704021a35ac8e54bcb4d9a2a39d9628b933aec5734a60b719a7f09667e2fdf92b5014b63bbc59dfe8e692470296b000d
7
+ data.tar.gz: 2bf362b24948251ba3b18fff1806fd00fcfd2415abb3ea026133b189183643c60932ad15396fccb70deb33ac3be7932a105aa95dffd0afd4ce4034b5662ba124
data/.gitignore CHANGED
@@ -17,6 +17,7 @@ mkmf.log
17
17
  Gemfile.lock
18
18
  .bundle
19
19
  .ruby-version
20
+ .vscode
20
21
 
21
22
  # Node
22
23
  node_modules
data/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
- # master
1
+ # Changelog
2
2
 
3
- # 1.0.0 / 2020-05-29
3
+ ## 1.1.2 / 2021-10-11
4
+
5
+ * Upgrade to newer Lit
6
+ * Switch from `site.pages` to `site.generated_pages` due to Bridgetown 1.0 API change
7
+
8
+ ## 1.1.1 / 2021-07-18
9
+
10
+ * Allow for styling of links
11
+
12
+ ## 1.1.0 / 2021-06-04
13
+
14
+ * Support the Resource content engine in Bridgetown 0.20+
15
+
16
+ ## 1.0.5 / 2020-11-05
17
+
18
+ * Add `template_engine: liquid` to the JSON index so it plays well with Bridgetown 0.18+
19
+
20
+ ## 1.0.0 / 2020-05-29
4
21
 
5
22
  * DOCS COMING
data/README.md CHANGED
@@ -22,7 +22,7 @@ Next, add this line to the top of your frontend's Javascript index file:
22
22
  import "bridgetown-quick-search"
23
23
  ```
24
24
 
25
- Or if you need a precompiled version created with Babel, you can instead
25
+ Or if you need a precompiled version (without experimental decorators), you can instead
26
26
  add the following:
27
27
 
28
28
  ```js
@@ -37,6 +37,12 @@ Then add the Liquid component to one of your site templates, for example `src/_c
37
37
  {% render "bridgetown_quick_search/search" %}
38
38
  ```
39
39
 
40
+ If you're using a Ruby-based template (ERB, etc.), you can use the `liquid_render` helper:
41
+
42
+ ```html
43
+ <%= liquid_render "bridgetown_quick_search/search" %>
44
+ ```
45
+
40
46
  ## Component Options
41
47
 
42
48
  You can provide additional Liquid variables to the component to configure its appearance. These are:
@@ -74,6 +80,10 @@ bridgetown-search-results {
74
80
  bridgetown-search-results::part(inner) {
75
81
  /* Adjust the popup contents wrapper */
76
82
  }
83
+
84
+ bridgetown-search-results::part(inner-link) {
85
+ /* Adjust the link style of each search result */
86
+ }
77
87
  ```
78
88
 
79
89
  ## Controlling the Search Index
@@ -1,13 +1,18 @@
1
1
  ---
2
+ template_engine: liquid
2
3
  ---
3
4
  [
4
5
  {%- assign looped = false %}
5
- {%- for document in site.documents %}
6
+ {%- assign documents = site.documents %}
7
+ {%- if site.content_engine == "resource" %}{% assign documents = site.resources %}{% endif %}
8
+ {%- for document in documents %}
6
9
  {%- if document.title %}
7
- {%- unless document.exclude_from_search %}
10
+ {%- unless document.exclude_from_search or document.id == "" %}
11
+ {%- assign url = document.url %}
12
+ {%- if site.content_engine == "resource" %}{% assign url = document.relative_url %}{% endif %}
8
13
  {%- if looped %},{% endif %}
9
14
  {
10
- "id": "{{ document.url | slugify }}",
15
+ "id": "{{ url | slugify }}",
11
16
  "title": {{ document.title | jsonify }},
12
17
  {%- if document.collection %}
13
18
  "collection": {
@@ -17,14 +22,14 @@
17
22
  {%- endif %}
18
23
  "categories": {{ document.categories | join: ", " | jsonify }},
19
24
  "tags": {{ document.tags | join: ", " | jsonify }},
20
- "url": {{ document.url | jsonify }},
25
+ "url": {{ url | jsonify }},
21
26
  "content": {{ document.content | strip_html | replace_regex: "[\s/\n]+"," " | strip | jsonify }}
22
27
  }
23
28
  {%- assign looped = true %}
24
29
  {%- endunless %}
25
30
  {%- endif %}
26
31
  {%- endfor %}
27
- {%- for document in site.pages %}
32
+ {%- for document in site.generated_pages %}
28
33
  {%- if document.name contains ".md" or document.name contains ".html" %}
29
34
  {%- if document.title %}
30
35
  {%- unless document.exclude_from_search %}
data/jsconfig.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "compilerOptions": {
3
+ "experimentalDecorators": true
4
+ },
5
+ "include": ["frontend/**/*"]
6
+ }
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Bridgetown
4
4
  module QuickSearch
5
- VERSION = "1.0.4"
5
+ VERSION = "1.1.2"
6
6
  end
7
7
  end
data/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "bridgetown-quick-search",
3
- "version": "1.0.4",
3
+ "version": "1.1.2",
4
4
  "main": "frontend/javascript/index.js",
5
5
  "module": "frontend/javascript/index.js",
6
6
  "exports": {
7
+ ".": "./frontend/javascript/index.js",
7
8
  "./dist": {
8
9
  "browser": "./frontend/dist/index.js",
9
10
  "import": "./frontend/dist/index.js"
@@ -25,7 +26,7 @@
25
26
  },
26
27
  "dependencies": {
27
28
  "@babel/runtime": "^7.10.1",
28
- "lit-element": "^2.3.1",
29
+ "lit": "^2.0.0",
29
30
  "lunr": "^2.3.8"
30
31
  },
31
32
  "devDependencies": {
data/yarn.lock CHANGED
@@ -241,6 +241,11 @@
241
241
  lodash "^4.17.19"
242
242
  to-fast-properties "^2.0.0"
243
243
 
244
+ "@lit/reactive-element@^1.0.0":
245
+ version "1.0.1"
246
+ resolved "https://registry.yarnpkg.com/@lit/reactive-element/-/reactive-element-1.0.1.tgz#853cacd4d78d79059f33f66f8e7b0e5c34bee294"
247
+ integrity sha512-nSD5AA2AZkKuXuvGs8IK7K5ZczLAogfDd26zT9l6S7WzvqALdVWcW5vMUiTnZyj5SPcNwNNANj0koeV1ieqTFQ==
248
+
244
249
  "@nicolo-ribaudo/chokidar-2@^2.1.8":
245
250
  version "2.1.8"
246
251
  resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8.tgz#eef8d9b47e8dc589499f14d656e8d2dd978c3d14"
@@ -248,6 +253,11 @@
248
253
  dependencies:
249
254
  chokidar "2.1.8"
250
255
 
256
+ "@types/trusted-types@^2.0.2":
257
+ version "2.0.2"
258
+ resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.2.tgz#fc25ad9943bcac11cceb8168db4f275e0e72e756"
259
+ integrity sha512-F5DIZ36YVLE+PN+Zwws4kJogq47hNgX3Nx6WyDJ3kcplxyke3XIzB8uK5n/Lpm1HBsbGzd6nmGehL8cPekP+Tg==
260
+
251
261
  ansi-styles@^3.2.1:
252
262
  version "3.2.1"
253
263
  resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
@@ -930,22 +940,34 @@ kind-of@^6.0.0, kind-of@^6.0.2:
930
940
  resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd"
931
941
  integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==
932
942
 
933
- lit-element@^2.3.1:
934
- version "2.4.0"
935
- resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-2.4.0.tgz#b22607a037a8fc08f5a80736dddf7f3f5d401452"
936
- integrity sha512-pBGLglxyhq/Prk2H91nA0KByq/hx/wssJBQFiYqXhGDvEnY31PRGYf1RglVzyLeRysu0IHm2K0P196uLLWmwFg==
943
+ lit-element@^3.0.0:
944
+ version "3.0.1"
945
+ resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-3.0.1.tgz#3c545af17d8a46268bc1dd5623a47486e6ff76f4"
946
+ integrity sha512-vs9uybH9ORyK49CFjoNGN85HM9h5bmisU4TQ63phe/+GYlwvY/3SIFYKdjV6xNvzz8v2MnVC+9+QOkPqh+Q3Ew==
937
947
  dependencies:
938
- lit-html "^1.1.1"
948
+ "@lit/reactive-element" "^1.0.0"
949
+ lit-html "^2.0.0"
939
950
 
940
- lit-html@^1.1.1:
941
- version "1.3.0"
942
- resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-1.3.0.tgz#c80f3cc5793a6dea6c07172be90a70ab20e56034"
943
- integrity sha512-0Q1bwmaFH9O14vycPHw8C/IeHMk/uSDldVLIefu/kfbTBGIc44KGH6A8p1bDfxUfHdc8q6Ct7kQklWoHgr4t1Q==
951
+ lit-html@^2.0.0:
952
+ version "2.0.1"
953
+ resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-2.0.1.tgz#63241015efa07bc9259b6f96f04abd052d2a1f95"
954
+ integrity sha512-KF5znvFdXbxTYM/GjpdOOnMsjgRcFGusTnB54ixnCTya5zUR0XqrDRj29ybuLS+jLXv1jji6Y8+g4W7WP8uL4w==
955
+ dependencies:
956
+ "@types/trusted-types" "^2.0.2"
957
+
958
+ lit@^2.0.0:
959
+ version "2.0.2"
960
+ resolved "https://registry.yarnpkg.com/lit/-/lit-2.0.2.tgz#5e6f422924e0732258629fb379556b6d23f7179c"
961
+ integrity sha512-hKA/1YaSB+P+DvKWuR2q1Xzy/iayhNrJ3aveD0OQ9CKn6wUjsdnF/7LavDOJsKP/K5jzW/kXsuduPgRvTFrFJw==
962
+ dependencies:
963
+ "@lit/reactive-element" "^1.0.0"
964
+ lit-element "^3.0.0"
965
+ lit-html "^2.0.0"
944
966
 
945
967
  lodash@^4.17.19:
946
- version "4.17.20"
947
- resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
948
- integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==
968
+ version "4.17.21"
969
+ resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
970
+ integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
949
971
 
950
972
  lunr@^2.3.8:
951
973
  version "2.3.9"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridgetown-quick-search
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-22 00:00:00.000000000 Z
11
+ date: 2021-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bridgetown
@@ -118,6 +118,7 @@ files:
118
118
  - bridgetown-quick-search.gemspec
119
119
  - components/bridgetown_quick_search/search.liquid
120
120
  - content/bridgetown_quick_search/index.json
121
+ - jsconfig.json
121
122
  - lib/bridgetown-quick-search.rb
122
123
  - lib/bridgetown-quick-search/version.rb
123
124
  - package.json
@@ -126,7 +127,7 @@ homepage: https://github.com/bridgetownrb/bridgetown-quick-search
126
127
  licenses:
127
128
  - MIT
128
129
  metadata:
129
- yarn-add: bridgetown-quick-search@1.0.4
130
+ yarn-add: bridgetown-quick-search@1.1.2
130
131
  post_install_message:
131
132
  rdoc_options: []
132
133
  require_paths:
@@ -142,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
143
  - !ruby/object:Gem::Version
143
144
  version: '0'
144
145
  requirements: []
145
- rubygems_version: 3.0.8
146
+ rubygems_version: 3.1.4
146
147
  signing_key:
147
148
  specification_version: 4
148
149
  summary: A Liquid + Web Component for Bridgetown sites which performs search queries