bridgetown-quick-search 1.0.5 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -3
- data/README.md +12 -2
- data/components/bridgetown_quick_search/search.liquid +2 -3
- data/content/bridgetown_quick_search/index.json +9 -5
- data/lib/bridgetown-quick-search/version.rb +1 -1
- data/package.json +3 -2
- data/yarn.lock +34 -12
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25458440262a79aa91b1f6961ed7df41eef00a4350584a4e0441218715270610
|
4
|
+
data.tar.gz: 030e1497c975cf0da2c72c20965ab21b53f13793cfa4eb163bc1c38ea9d9cc63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6ae2ec88462c4309cbf0276a616f4df67625ed72196d2152f192dbe58c411cf6d358aeaea9c66ae65f5540a689cfbe230d53f7981fd93a11c025a532ae8ce47
|
7
|
+
data.tar.gz: 7528416231c12f8efb183e1d26f182c4146f5a3363022f473c227d647fb20a7b5ce9f04ff94bfbebb24378cac46fc887d6c4201dad16fd356126de9fa6937122
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +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
|
4
17
|
|
5
18
|
* Add `template_engine: liquid` to the JSON index so it plays well with Bridgetown 0.18+
|
6
19
|
|
7
|
-
|
20
|
+
## 1.0.0 / 2020-05-29
|
8
21
|
|
9
22
|
* DOCS COMING
|
data/README.md
CHANGED
@@ -22,13 +22,13 @@ 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
|
29
29
|
// frontend/javascript/index.js
|
30
30
|
|
31
|
-
import "bridgetown-quick-search/
|
31
|
+
import "bridgetown-quick-search/dist"
|
32
32
|
```
|
33
33
|
|
34
34
|
Then add the Liquid component to one of your site templates, for example `src/_components/navbar.liquid`:
|
@@ -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,11 +1,10 @@
|
|
1
|
-
|
2
|
-
name: Bridgetown Quick Search
|
1
|
+
{% comment %}
|
3
2
|
variables:
|
4
3
|
input_class?: [string, Custom class(es) to apply to the search input control.]
|
5
4
|
placeholder?: [string, Placeholder text for the search input control.]
|
6
5
|
theme: [string, Dark or Light theme ("dark" or "light"). Defaults to light.]
|
7
6
|
snippet_length?: [integer, Length of the result text snippet. Defaults to 142.]
|
8
|
-
|
7
|
+
{% endcomment %}
|
9
8
|
<bridgetown-search-form>
|
10
9
|
<input slot="input" type="search" class="{{ input_class }}" placeholder="{{ placeholder }}" />
|
11
10
|
<bridgetown-search-results {% if snippet_length %}snippetlength="{{ snippet_length }}" {% endif %}theme="{% if theme %}{{ theme }}{% endif %}"></bridgetown-search-results>
|
@@ -3,12 +3,16 @@ template_engine: liquid
|
|
3
3
|
---
|
4
4
|
[
|
5
5
|
{%- assign looped = false %}
|
6
|
-
{%-
|
6
|
+
{%- assign documents = site.documents %}
|
7
|
+
{%- if site.content_engine == "resource" %}{% assign documents = site.resources %}{% endif %}
|
8
|
+
{%- for document in documents %}
|
7
9
|
{%- if document.title %}
|
8
|
-
{%- 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 %}
|
9
13
|
{%- if looped %},{% endif %}
|
10
14
|
{
|
11
|
-
"id": "{{
|
15
|
+
"id": "{{ url | slugify }}",
|
12
16
|
"title": {{ document.title | jsonify }},
|
13
17
|
{%- if document.collection %}
|
14
18
|
"collection": {
|
@@ -18,14 +22,14 @@ template_engine: liquid
|
|
18
22
|
{%- endif %}
|
19
23
|
"categories": {{ document.categories | join: ", " | jsonify }},
|
20
24
|
"tags": {{ document.tags | join: ", " | jsonify }},
|
21
|
-
"url": {{
|
25
|
+
"url": {{ url | jsonify }},
|
22
26
|
"content": {{ document.content | strip_html | replace_regex: "[\s/\n]+"," " | strip | jsonify }}
|
23
27
|
}
|
24
28
|
{%- assign looped = true %}
|
25
29
|
{%- endunless %}
|
26
30
|
{%- endif %}
|
27
31
|
{%- endfor %}
|
28
|
-
{%- for document in site.
|
32
|
+
{%- for document in site.generated_pages %}
|
29
33
|
{%- if document.name contains ".md" or document.name contains ".html" %}
|
30
34
|
{%- if document.title %}
|
31
35
|
{%- unless document.exclude_from_search %}
|
data/package.json
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"name": "bridgetown-quick-search",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.1.3",
|
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.3
|
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-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bridgetown
|
@@ -127,7 +127,7 @@ homepage: https://github.com/bridgetownrb/bridgetown-quick-search
|
|
127
127
|
licenses:
|
128
128
|
- MIT
|
129
129
|
metadata:
|
130
|
-
yarn-add: bridgetown-quick-search@1.
|
130
|
+
yarn-add: bridgetown-quick-search@1.1.3
|
131
131
|
post_install_message:
|
132
132
|
rdoc_options: []
|
133
133
|
require_paths:
|
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
143
|
- !ruby/object:Gem::Version
|
144
144
|
version: '0'
|
145
145
|
requirements: []
|
146
|
-
rubygems_version: 3.
|
146
|
+
rubygems_version: 3.1.4
|
147
147
|
signing_key:
|
148
148
|
specification_version: 4
|
149
149
|
summary: A Liquid + Web Component for Bridgetown sites which performs search queries
|