astro-accelerator 4.0.0 → 4.0.2

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.
Files changed (61) hide show
  1. package/README.md +4 -0
  2. package/package.json +6 -6
  3. package/src/pages/search.json.ts +6 -9
  4. package/.npmrc +0 -2
  5. package/public/css/main.css +0 -1189
  6. package/public/css/vars.css +0 -89
  7. package/public/icons/android-chrome-192x192.png +0 -0
  8. package/public/icons/android-chrome-512x512.png +0 -0
  9. package/public/icons/apple-touch-icon.png +0 -0
  10. package/public/icons/favicon-16x16.png +0 -0
  11. package/public/icons/favicon-32x32.png +0 -0
  12. package/public/icons/favicon.ico +0 -0
  13. package/public/js/main.js +0 -66
  14. package/public/js/modules/animation.js +0 -69
  15. package/public/js/modules/click-blocks.js +0 -42
  16. package/public/js/modules/code-blocks.js +0 -59
  17. package/public/js/modules/detail-tabs.js +0 -194
  18. package/public/js/modules/events.js +0 -19
  19. package/public/js/modules/external-links.js +0 -20
  20. package/public/js/modules/figures.js +0 -28
  21. package/public/js/modules/focus.js +0 -76
  22. package/public/js/modules/headers.js +0 -21
  23. package/public/js/modules/input-type.js +0 -53
  24. package/public/js/modules/nav-mobile.js +0 -159
  25. package/public/js/modules/nav-sticky.js +0 -56
  26. package/public/js/modules/query.js +0 -41
  27. package/public/js/modules/resizing.js +0 -43
  28. package/public/js/modules/search-dialog.js +0 -69
  29. package/public/js/modules/share.js +0 -31
  30. package/public/js/modules/string.js +0 -77
  31. package/public/js/modules/toc.js +0 -82
  32. package/public/js/modules/youtube.js +0 -44
  33. package/public/js/search.js +0 -615
  34. package/src/themes/accelerator/components/ArticleList.astro +0 -90
  35. package/src/themes/accelerator/components/Authors.astro +0 -65
  36. package/src/themes/accelerator/components/AuthorsMini.astro +0 -41
  37. package/src/themes/accelerator/components/Breadcrumbs.astro +0 -53
  38. package/src/themes/accelerator/components/Copyright.astro +0 -28
  39. package/src/themes/accelerator/components/Footer.astro +0 -37
  40. package/src/themes/accelerator/components/FooterItem.astro +0 -31
  41. package/src/themes/accelerator/components/Header.astro +0 -46
  42. package/src/themes/accelerator/components/HtmlHead.astro +0 -60
  43. package/src/themes/accelerator/components/Navigation.astro +0 -34
  44. package/src/themes/accelerator/components/NavigationBar.astro +0 -33
  45. package/src/themes/accelerator/components/NavigationItem.astro +0 -40
  46. package/src/themes/accelerator/components/PagingLinks.astro +0 -36
  47. package/src/themes/accelerator/components/RecentlyUpdated.astro +0 -38
  48. package/src/themes/accelerator/components/Related.astro +0 -87
  49. package/src/themes/accelerator/components/SkipLinks.astro +0 -29
  50. package/src/themes/accelerator/components/TableOfContents.astro +0 -46
  51. package/src/themes/accelerator/components/Taxonomy.astro +0 -53
  52. package/src/themes/accelerator/layouts/Author.astro +0 -27
  53. package/src/themes/accelerator/layouts/Default.astro +0 -83
  54. package/src/themes/accelerator/layouts/Redirect.astro +0 -29
  55. package/src/themes/accelerator/layouts/Search.astro +0 -48
  56. package/src/themes/accelerator/utilities/Languages.ts +0 -21
  57. package/src/themes/accelerator/utilities/custom-markdown.mjs +0 -142
  58. package/src/themes/accelerator/utilities/default-layout.mjs +0 -7
  59. package/src/themes/accelerator/utilities/img.mjs +0 -142
  60. package/src/themes/accelerator/utilities/language.json +0 -117
  61. package/src/themes/accelerator/utilities/stats.mjs +0 -44
package/README.md CHANGED
@@ -7,3 +7,7 @@ Review the documentation at [astro.stevefenton.co.uk](https://astro.stevefenton.
7
7
 
8
8
  [![npm](https://img.shields.io/npm/v/astro-accelerator?color=blue&style=plastic)](https://www.npmjs.com/package/astro-accelerator/)
9
9
  [![npm](https://img.shields.io/npm/dm/astro-accelerator?style=plastic)](https://www.npmjs.com/package/astro-accelerator/)
10
+
11
+ ## Upgrades
12
+
13
+ - [Upgrading from v3 to v4 of Astro and Astro Accelerator.](https://www.stevefenton.co.uk/blog/2023/12/upgrade-astro-v4/)
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.0.0",
2
+ "version": "4.0.2",
3
3
  "author": "Steve Fenton",
4
4
  "name": "astro-accelerator",
5
5
  "description": "A super-lightweight, accessible, SEO-friendly starter project for Astro",
@@ -31,16 +31,16 @@
31
31
  "dts": "tsc ./tests/locate-content.js ./tests/locate-navigation.js ./tests/locate-search.js --allowJs --declaration --emitDeclarationOnly"
32
32
  },
33
33
  "dependencies": {
34
- "@astrojs/mdx": "^2.0.0",
35
- "astro": "^4.0.3",
34
+ "@astrojs/mdx": "^2.0.3",
35
+ "astro": "^4.0.8",
36
36
  "astro-accelerator-utils": "^0.3.5",
37
- "cspell": "^8.1.3",
38
- "csv": "^6.3.5",
37
+ "cspell": "^8.3.1",
38
+ "csv": "^6.3.6",
39
39
  "hast-util-from-selector": "^3.0.0",
40
40
  "html-to-text": "^9.0.5",
41
41
  "keyword-extractor": "^0.0.28",
42
42
  "remark-directive": "^3.0.0",
43
- "sharp": "^0.33.0"
43
+ "sharp": "^0.33.1"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@playwright/test": "^1.40.1"
@@ -3,7 +3,7 @@
3
3
  import { Accelerator, PostFiltering } from 'astro-accelerator-utils';
4
4
  import type { MarkdownInstance } from 'astro';
5
5
  import { SITE } from '@config';
6
- import { htmlToText } from 'html-to-text';
6
+ import { htmlToText, convert } from 'html-to-text';
7
7
  import keywordExtractor from 'keyword-extractor';
8
8
 
9
9
 
@@ -33,20 +33,17 @@ const getData = async () => {
33
33
  let counted: { word: string, count: number }[] = [];
34
34
 
35
35
  if (content) {
36
- const text = htmlToText(content, { wordwrap: false });
36
+ const text = convert(content, { wordwrap: false });
37
37
 
38
38
  const words = keywordExtractor.extract(text, {
39
39
  language: 'english',
40
- return_changed_case: true
40
+ return_changed_case: true,
41
+ remove_duplicates: true
41
42
  });
42
43
 
43
- function unique (value: string, index: number, array: string[]) {
44
- return array.indexOf(value) === index;
45
- }
46
- const uniques = words.filter(unique);
47
- counted = uniques.map((w) => {
44
+ counted = words.map((w) => {
48
45
  return { word: w, count: words.filter(wd => wd === w).length };
49
- }).filter(e => e.word.replace(/[^a-z]+/g, '').length > 1 && e.count > 1);
46
+ }).filter(e => e.word.replace(/[^a-z]+/g, '').length > 1);
50
47
  }
51
48
 
52
49
  items.push({
package/.npmrc DELETED
@@ -1,2 +0,0 @@
1
- # Expose Astro dependencies for `pnpm` users
2
- shamefully-hoist=true