astro-accelerator 5.10.4 → 5.10.5

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
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.10.4",
2
+ "version": "5.10.5",
3
3
  "author": "Steve Fenton",
4
4
  "name": "astro-accelerator",
5
5
  "description": "A super-lightweight, accessible, SEO-friendly starter project for Astro",
@@ -34,7 +34,15 @@ const getData = async () => {
34
34
  let counted: { word: string; count: number }[] = [];
35
35
 
36
36
  if (content) {
37
- const text = convert(content, { wordwrap: false });
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
- <Default frontmatter={ frontmatter } headings={ headings }>
30
+
31
+ <Default frontmatter={frontmatter} headings={headings}>
31
32
  <slot />
32
- <form method="GET" action={ SITE.search.fallbackUrl ?? 'https://www.google.com/search' } role="search" id="site-search" class="site-search note" autocomplete="off" data-sourcedata={ SITE.subfolder + '/search.json' }>
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={ SITE.search.fallbackSite ?? 'q' } value={ 'site:' + siteUrl } />
42
+ <input type="hidden" name={SITE.search.fallbackSite ?? 'q'} value={'site:' + siteUrl} />
35
43
  <div>
36
- <label for="site-search-query">{ _(Translations.search.search_for) }</label>
37
- <input
38
- type="text"
39
- name={ SITE.search.fallbackSite ?? 'q' }
40
- id="site-search-query"
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
- <button id="site-search-button" type="submit">{ _(Translations.search.submit) }</button>
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 id="site-search-results" data-title={ _(Translations.search.results_title) } data-emptytitle={ _(Translations.search.no_results_title) }>
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={ SITE.subfolder + '/js/search.js' } type="module" async></script>
50
- </Default>
62
+ <script src={SITE.subfolder + '/js/search.js'} type="module" async></script>
63
+ </Default>