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 +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +19 -2
- data/README.md +11 -1
- data/content/bridgetown_quick_search/index.json +10 -5
- data/jsconfig.json +6 -0
- data/lib/bridgetown-quick-search/version.rb +1 -1
- data/package.json +3 -2
- data/yarn.lock +34 -12
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 768480c9d41d98c78703497a4008b763b26f69eb8430bd6ad0553921adae97c3
|
4
|
+
data.tar.gz: ab6c066d1eba6fc352d4c44c1ae68dc8bba0051df767e2323ea225e1d218e2c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e00a482fef880762507b7239a17b91e704021a35ac8e54bcb4d9a2a39d9628b933aec5734a60b719a7f09667e2fdf92b5014b63bbc59dfe8e692470296b000d
|
7
|
+
data.tar.gz: 2bf362b24948251ba3b18fff1806fd00fcfd2415abb3ea026133b189183643c60932ad15396fccb70deb33ac3be7932a105aa95dffd0afd4ce4034b5662ba124
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,22 @@
|
|
1
|
-
#
|
1
|
+
# Changelog
|
2
2
|
|
3
|
-
|
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
|
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
|
-
{%-
|
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": "{{
|
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": {{
|
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.
|
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
data/package.json
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"name": "bridgetown-quick-search",
|
3
|
-
"version": "1.
|
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
|
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@^
|
934
|
-
version "
|
935
|
-
resolved "https://registry.yarnpkg.com/lit-element/-/lit-element-
|
936
|
-
integrity sha512-
|
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-
|
948
|
+
"@lit/reactive-element" "^1.0.0"
|
949
|
+
lit-html "^2.0.0"
|
939
950
|
|
940
|
-
lit-html@^
|
941
|
-
version "
|
942
|
-
resolved "https://registry.yarnpkg.com/lit-html/-/lit-html-
|
943
|
-
integrity sha512-
|
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.
|
947
|
-
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.
|
948
|
-
integrity sha512-
|
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.
|
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:
|
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.
|
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.
|
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
|