astro-accelerator 5.10.4 → 5.10.6
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.
package/package.json
CHANGED
package/src/pages/search.json.ts
CHANGED
|
@@ -34,7 +34,15 @@ const getData = async () => {
|
|
|
34
34
|
let counted: { word: string; count: number }[] = [];
|
|
35
35
|
|
|
36
36
|
if (content) {
|
|
37
|
-
const
|
|
37
|
+
const options = {
|
|
38
|
+
wordwrap: false,
|
|
39
|
+
selectors: [
|
|
40
|
+
{ selector: 'a', options: { ignoreHref: true } },
|
|
41
|
+
{ selector: 'img', format: 'skip' },
|
|
42
|
+
{ selector: 'h1', options: { uppercase: false } },
|
|
43
|
+
],
|
|
44
|
+
};
|
|
45
|
+
const text = convert(content, options);
|
|
38
46
|
|
|
39
47
|
const words = keywordExtractor.extract(text, {
|
|
40
48
|
language: 'english',
|
|
@@ -13,9 +13,9 @@ stats.start();
|
|
|
13
13
|
|
|
14
14
|
// Properties
|
|
15
15
|
type Props = {
|
|
16
|
-
frontmatter: Frontmatter
|
|
17
|
-
headings: { depth: number; slug: string; text: string
|
|
18
|
-
}
|
|
16
|
+
frontmatter: Frontmatter;
|
|
17
|
+
headings: { depth: number; slug: string; text: string }[];
|
|
18
|
+
};
|
|
19
19
|
const { frontmatter, headings } = Astro.props satisfies Props;
|
|
20
20
|
const lang = frontmatter.lang ?? SITE.default.lang;
|
|
21
21
|
|
|
@@ -27,24 +27,37 @@ const siteUrl = Astro.site ? Astro.site.href : '';
|
|
|
27
27
|
|
|
28
28
|
stats.stop();
|
|
29
29
|
---
|
|
30
|
-
|
|
30
|
+
|
|
31
|
+
<Default frontmatter={frontmatter} headings={headings}>
|
|
31
32
|
<slot />
|
|
32
|
-
<form
|
|
33
|
+
<form
|
|
34
|
+
method="GET"
|
|
35
|
+
action={SITE.search.fallbackUrl ?? 'https://www.google.com/search'}
|
|
36
|
+
role="search"
|
|
37
|
+
id="site-search"
|
|
38
|
+
class="site-search note"
|
|
39
|
+
autocomplete="off"
|
|
40
|
+
data-sourcedata={SITE.subfolder + '/search.json'}>
|
|
33
41
|
<fieldset>
|
|
34
|
-
<input type="hidden" name={
|
|
42
|
+
<input type="hidden" name={SITE.search.fallbackSite ?? 'q'} value={'site:' + siteUrl} />
|
|
35
43
|
<div>
|
|
36
|
-
<label for="site-search-query">{
|
|
37
|
-
<input
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
44
|
+
<label for="site-search-query">{_(Translations.search.search_for)}</label>
|
|
45
|
+
<input
|
|
46
|
+
autofocus="autofocus"
|
|
47
|
+
type="text"
|
|
48
|
+
name={SITE.search.fallbackSite ?? 'q'}
|
|
49
|
+
id="site-search-query"
|
|
41
50
|
spellcheck="true"
|
|
42
|
-
autocomplete="off"
|
|
43
|
-
|
|
51
|
+
autocomplete="off"
|
|
52
|
+
/>
|
|
53
|
+
<button id="site-search-button" type="submit">{_(Translations.search.submit)}</button>
|
|
44
54
|
</div>
|
|
45
55
|
</fieldset>
|
|
46
56
|
</form>
|
|
47
|
-
<div
|
|
57
|
+
<div
|
|
58
|
+
id="site-search-results"
|
|
59
|
+
data-title={_(Translations.search.results_title)}
|
|
60
|
+
data-emptytitle={_(Translations.search.no_results_title)}>
|
|
48
61
|
</div>
|
|
49
|
-
<script src={
|
|
50
|
-
</Default>
|
|
62
|
+
<script src={SITE.subfolder + '/js/search.js'} type="module" async></script>
|
|
63
|
+
</Default>
|