jeawin-astro 3.0.46 → 3.0.49

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,6 +1,6 @@
1
1
  {
2
2
  "name": "jeawin-astro",
3
- "version": "3.0.46",
3
+ "version": "3.0.49",
4
4
  "author": "chaegumi <chaegumi@qq.com>",
5
5
  "description": "",
6
6
  "license": "MIT",
@@ -65,7 +65,7 @@
65
65
  "@types/alpinejs": "^3.13.11",
66
66
  "alpinejs": "^3.14.9",
67
67
  "aos": "3.0.0-beta.6",
68
- "astro": "^5.5.4",
68
+ "astro": "^5.7.0",
69
69
  "astro-color-scheme": "^1.1.5",
70
70
  "astro-embed": "^0.9.0",
71
71
  "astro-icon": "^1.1.5",
@@ -116,7 +116,7 @@ const menus = await jeawinapi.get_menu_tree({ menu_id: 1 });
116
116
  menus.map((menu: any) =>
117
117
  menu.children ? (
118
118
  <Fragment>
119
- {menu.style == "1" ? (
119
+ {menu.style > 0 ? (
120
120
  <MegaMenu menu={menu} menu_root_link_id={menu_root_link_id}>
121
121
  <Fragment
122
122
  set:html={Astro.slots.render("megamenu", [menu])}
@@ -74,7 +74,7 @@ import "smartmenus/dist/css/smartmenus.min.css"
74
74
  menus.map((menu: any) =>
75
75
  menu.children ? (
76
76
  <Fragment>
77
- {menu.style == "1" ? (
77
+ {menu.style > 0 ? (
78
78
  <MegaMenu menu={menu} menu_root_link_id={menu_root_link_id}>
79
79
  <Fragment
80
80
  set:html={Astro.slots.render("megamenu", [menu])}
@@ -42,3 +42,7 @@ export function is_pagefind(language_id: any): boolean;
42
42
  * 输出多语言项
43
43
  */
44
44
  export function render_lang(all_langs: any, key: any): any;
45
+ /**
46
+ * 去除内容中的toc
47
+ */
48
+ export function without_toc(content: any): string;
@@ -344,4 +344,14 @@ export function is_pagefind(language_id) {
344
344
  */
345
345
  export function render_lang(all_langs, key){
346
346
  return render_value(all_langs, key, key);
347
+ }
348
+
349
+ /**
350
+ * 去除内容中的toc
351
+ */
352
+ export function without_toc(content){
353
+ const $ = cheerio.load(content);
354
+ $('script')?.remove();
355
+ $('.toc-anchor')?.remove();
356
+ return $.html();
347
357
  }