Skip to content

Commit 16e7f52

Browse files
committed
[netlify-ignore]update yarn
2 parents 0150b95 + 6728f73 commit 16e7f52

File tree

33 files changed

+2580
-2720
lines changed

33 files changed

+2580
-2720
lines changed

js/algolia/highlight.js

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
import {
2+
parseAlgoliaHitHighlight,
3+
parseAlgoliaHitReverseHighlight,
4+
parseAlgoliaHitSnippet,
5+
parseAlgoliaHitReverseSnippet,
6+
} from '@algolia/autocomplete-preset-algolia';
7+
8+
function concatParts(parts, {
9+
highlightPreTag,
10+
highlightPostTag
11+
}) {
12+
return parts.reduce((acc, current) => {
13+
return (acc +
14+
(current.isHighlighted ?
15+
`${highlightPreTag}${current.value}${highlightPostTag}` :
16+
current.value));
17+
}, '');
18+
}
19+
/**
20+
* Highlights and escapes the matching parts of an Algolia hit.
21+
*/
22+
export function highlightHit({
23+
hit,
24+
attribute,
25+
highlightPreTag = '<mark>',
26+
highlightPostTag = '</mark>',
27+
ignoreEscape,
28+
}) {
29+
return concatParts(parseAlgoliaHitHighlight({
30+
hit,
31+
attribute,
32+
ignoreEscape,
33+
}), {
34+
highlightPreTag,
35+
highlightPostTag
36+
});
37+
}
38+
/**
39+
* Highlights and escapes the non-matching parts of an Algolia hit.
40+
*
41+
* This is a common pattern for Query Suggestions.
42+
*/
43+
export function reverseHighlightHit({
44+
hit,
45+
attribute,
46+
highlightPreTag = '<mark>',
47+
highlightPostTag = '</mark>',
48+
ignoreEscape,
49+
}) {
50+
return concatParts(parseAlgoliaHitReverseHighlight({
51+
hit,
52+
attribute,
53+
ignoreEscape,
54+
}), {
55+
highlightPreTag,
56+
highlightPostTag
57+
});
58+
}
59+
/**
60+
* Highlights and escapes the matching parts of an Algolia hit snippet.
61+
*/
62+
export function snippetHit({
63+
hit,
64+
attribute,
65+
highlightPreTag = '<mark>',
66+
highlightPostTag = '</mark>',
67+
ignoreEscape,
68+
}) {
69+
return concatParts(parseAlgoliaHitSnippet({
70+
hit,
71+
attribute,
72+
ignoreEscape,
73+
}), {
74+
highlightPreTag,
75+
highlightPostTag
76+
});
77+
}
78+
/**
79+
* Highlights and escapes the non-matching parts of an Algolia hit snippet.
80+
*
81+
* This is a common pattern for Query Suggestions.
82+
*/
83+
export function reverseSnippetHit({
84+
hit,
85+
attribute,
86+
highlightPreTag = '<mark>',
87+
highlightPostTag = '</mark>',
88+
ignoreEscape,
89+
}) {
90+
return concatParts(parseAlgoliaHitReverseSnippet({
91+
hit,
92+
attribute,
93+
ignoreEscape,
94+
}), {
95+
highlightPreTag,
96+
highlightPostTag
97+
});
98+
}

js/algolia/index.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { html } from 'htm/preact';
21
import algoliasearch from 'algoliasearch/lite';
3-
import { autocomplete, getAlgoliaHits, highlightHit } from '@algolia/autocomplete-js';
2+
import { autocomplete, getAlgoliaResults } from '@algolia/autocomplete-js';
43
import {createAlgoliaInsightsPlugin} from '@algolia/autocomplete-plugin-algolia-insights';
54
import insightsClient from 'search-insights';
5+
import { highlightHit } from './highlight.js';
66

77

88
const sampleAppId = 'latency';
@@ -46,7 +46,7 @@ function initAutocomplete(item){
4646
return itemUrl;
4747
},
4848
getItems() {
49-
return getAlgoliaHits({
49+
return getAlgoliaResults({
5050
searchClient,
5151
queries: [
5252
{
@@ -62,17 +62,20 @@ function initAutocomplete(item){
6262
});
6363
},
6464
templates: {
65-
item({ item }){
65+
item({ item, createElement }){
6666
if (item.anchor != null) {
6767
var anchorLink = "#" + item.anchor;
6868
} else {
6969
var anchorLink = "";
7070
}
71-
return html `<a class="aa-link" href="/docs${item.url}${anchorLink}">
72-
<p class="aa-title" >${highlightHit({hit: item, attribute: 'title'})}</h3>
73-
<p class="aa-heading">${item.headings.join(' >')}</p>
74-
<p class="aa-content">${highlightHit({hit: item, attribute: 'content'})}</p></a>
75-
`;
71+
return createElement('div',{
72+
dangerouslySetInnerHTML: {
73+
__html: `<a class="aa-link" href="/docs${item.url}${anchorLink}">
74+
<p class="aa-title" >${highlightHit({hit: item, attribute: 'title'})}</h3>
75+
<p class="aa-heading">${item.headings.join(' >')}</p>
76+
<p class="aa-content">${highlightHit({hit: item, attribute: 'content'})}</p></a>`
77+
}
78+
})
7679
},
7780
noResults() {
7881
return html `<p class="aa-content">No results for <strong>${query}</strong></p>`;

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
"scripts": {
1414
"develop": "bundle exec jekyll clean && webpack --mode production && JEKYLL_ENV=testing bundle exec jekyll build --trace -V",
1515
"develop-inc": "webpack --mode production && JEKYLL_ENV=testing bundle exec jekyll build --trace -V -I"
16-
17-
},
16+
},
1817
"devDependencies": {
1918
"@babel/cli": "^7.6.0",
2019
"@babel/core": "^7.6.0",

src/_data/catalog/destination_categories.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# AUTOGENERATED FROM PUBLIC API. DO NOT EDIT
2-
# destination categories last updated 2021-09-16
2+
# destination categories last updated 2021-09-17
33
items:
44
- display_name: A/B Testing
55
slug: a-b-testing

src/_data/catalog/destinations.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# AUTOGENERATED FROM PUBLIC API. DO NOT EDIT
2-
# destination data last updated 2021-09-16
2+
# destination data last updated 2021-09-17
33
items:
44
- display_name: 2mee
55
name: 2mee
@@ -883,13 +883,17 @@ items:
883883
- name: trackingServerSecureUrl
884884
type: string
885885
defaultValue: ''
886-
description: This is the secure URL of your Adobe Analytics server.
886+
description: >-
887+
This is the secure URL of your Adobe Analytics server. It should start
888+
with `https://`
887889
required: true
888890
label: Tracking Server Secure URL
889891
- name: trackingServerUrl
890892
type: string
891893
defaultValue: ''
892-
description: This is the URL of your Adobe Analytics server.
894+
description: >-
895+
This is the URL of your Adobe Analytics server. It should start with
896+
`http://`
893897
required: true
894898
label: Tracking Server URL
895899
- name: useLegacyLinkName

src/_data/catalog/source_categories.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# AUTOGENERATED FROM PUBLIC API. DO NOT EDIT
2-
# source cateogries last updated 2021-09-16
2+
# source cateogries last updated 2021-09-17
33
items:
44
- display_name: A/B Testing
55
slug: a-b-testing

src/_data/catalog/sources.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# AUTOGENERATED FROM PUBLIC API. DO NOT EDIT
2-
# sources last updated 2021-09-16
2+
# sources last updated 2021-09-17
33
items:
44
- display_name: .NET
55
slug: net

src/_data/catalog/warehouse_papi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# AUTOGENERATED FROM PUBLIC API. DO NOT EDIT
2-
# warehouse data last updated 2021-09-16
2+
# warehouse data last updated 2021-09-17
33
items:
44
- display_name: Azure SQL Data Warehouse
55
slug: azuresqldw

src/_includes/content/functions/runtime.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Per-function global caching is available in the `cache` namespace. The following
3333
- `cache.load(key: string, ttl: number, fn: async () => any): Promise<any>`
3434
- Obtains a cached value for the provided `key`, invoking the callback if the value is missing or has expired. The `ttl` is the maximum duration in milliseconds the value can be cached. If omitted or set to `-1`, the value will have no expiry. There is no guarantee that a value will be retained in the cache for the provided duration, however. The cache space is limited, so efforts to minimize the cached value size will afford a higher cache hit ratio.
3535
- `cache.delete(key: string): void`
36-
- Forcefully remove the value associated withe the `key`.
36+
- Forcefully remove the value associated with the `key`.
3737

3838
The following example gets a JSON value through the cache, only invoking the callback as needed:
3939

src/_release_notes/2020-12-09-ui-refresh.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ team: false
1515
# url: "docs/connections/storage/catalog/data-lakes"
1616
images:
1717
-
18-
path: /images/release-notes/ui-update-1.png
18+
path: images/release-notes/ui-update-1.png
1919
desc: The navigation was redesigned to better reflect how users navigate through the product.
2020
-
21-
path: /images/release-notes/ui-update-2.gif
21+
path: images/release-notes/ui-update-2.gif
2222
desc: A new workspace switcher provides an easier way to navigate between workspaces.
2323
---

0 commit comments

Comments
 (0)