jeawin-astro 3.0.36 → 3.0.38
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 +1 -1
- package/src/components/banner_swiper.astro +2 -1
- package/src/components/cards/news_grid_card1.astro +2 -1
- package/src/components/cards/news_grid_card2.astro +2 -1
- package/src/components/cards/news_grid_card3.astro +2 -1
- package/src/components/cards/news_grid_card4.astro +2 -1
- package/src/components/cards/news_grid_card5.astro +2 -1
- package/src/components/cards/news_list_card.astro +2 -1
- package/src/components/cards/news_list_card1.astro +2 -1
- package/src/components/common_card.astro +2 -2
- package/src/components/news_card.astro +2 -1
- package/src/components/product_card.astro +2 -1
- package/src/integrations/jeawin-astro-toolbar/toolbar.ts +12 -1
- package/src/integrations/jeawin-common-route/index.ts +16 -13
package/package.json
CHANGED
|
@@ -65,6 +65,7 @@ const banners = await jeawinapi.get_nodes({ channel_id: 5 });
|
|
|
65
65
|
mousewheel-force-to-axis="true"
|
|
66
66
|
navigation="true"
|
|
67
67
|
pagination="true"
|
|
68
|
+
auto-height="true"
|
|
68
69
|
>
|
|
69
70
|
{banners.nodes &&
|
|
70
71
|
banners.nodes.map((banner: any, idx: number) => (
|
|
@@ -72,7 +73,7 @@ const banners = await jeawinapi.get_nodes({ channel_id: 5 });
|
|
|
72
73
|
{show_title && render_value(banner, 'show_text_block', '1') == '1' ? (
|
|
73
74
|
<div class="relative h-full w-full">
|
|
74
75
|
<div class="absolute inset-0 flex items-center justify-center text-white text-center p-4">
|
|
75
|
-
<div class="p-2 bg-[rgba(0,0,0,0.5)]">
|
|
76
|
+
<div class="p-2 px-4 bg-[rgba(0,0,0,0.5)] rounded-sm">
|
|
76
77
|
{
|
|
77
78
|
idx > 0 ? (
|
|
78
79
|
<div class="text-base md:text-3xl lg:text-4xl">{banner.node_title}</div>
|
|
@@ -30,6 +30,7 @@ const {
|
|
|
30
30
|
publish_time,
|
|
31
31
|
hits,
|
|
32
32
|
title_tag,
|
|
33
|
+
title_class,
|
|
33
34
|
always_show_img,
|
|
34
35
|
} = Astro.props;
|
|
35
36
|
|
|
@@ -72,7 +73,7 @@ const final_content = truncate(content, {
|
|
|
72
73
|
>
|
|
73
74
|
{category_name}
|
|
74
75
|
</div>
|
|
75
|
-
<TitleTag class="title-font text-2xl font-medium text-gray-900 mb-3">
|
|
76
|
+
<TitleTag class:list={["title-font text-2xl font-medium text-gray-900 mb-3", title_class]}>
|
|
76
77
|
<a href={render_url(node_url, base, null, url_suffix)} title={title}>{title}</a>
|
|
77
78
|
</TitleTag>
|
|
78
79
|
|
|
@@ -25,6 +25,7 @@ const {
|
|
|
25
25
|
publish_time,
|
|
26
26
|
hits,
|
|
27
27
|
title_tag,
|
|
28
|
+
title_class
|
|
28
29
|
} = Astro.props;
|
|
29
30
|
|
|
30
31
|
const TitleTag = title_tag || "div";
|
|
@@ -44,7 +45,7 @@ const final_content = truncate(content, {
|
|
|
44
45
|
{category_name}
|
|
45
46
|
</div>
|
|
46
47
|
<TitleTag
|
|
47
|
-
class="title-font text-2xl font-medium text-gray-900 mb-3"
|
|
48
|
+
class:list={["title-font text-2xl font-medium text-gray-900 mb-3", title_class]}
|
|
48
49
|
>
|
|
49
50
|
<a href={render_url(node_url, base, null, url_suffix)} title={title}>{title}</a>
|
|
50
51
|
</TitleTag>
|
|
@@ -26,6 +26,7 @@ const {
|
|
|
26
26
|
publish_time,
|
|
27
27
|
hits,
|
|
28
28
|
title_tag,
|
|
29
|
+
title_class
|
|
29
30
|
} = Astro.props;
|
|
30
31
|
|
|
31
32
|
const TitleTag = title_tag || "div";
|
|
@@ -44,7 +45,7 @@ const final_content = truncate(content, {
|
|
|
44
45
|
>{category_name}</span
|
|
45
46
|
>
|
|
46
47
|
<TitleTag
|
|
47
|
-
class="sm:text-3xl text-2xl title-font font-medium text-gray-900 mt-4 mb-4"
|
|
48
|
+
class:list={["sm:text-3xl text-2xl title-font font-medium text-gray-900 mt-4 mb-4", title_class]}
|
|
48
49
|
>
|
|
49
50
|
<a href={render_url(node_url, base, null, url_suffix)} title={title}>{title}</a>
|
|
50
51
|
</TitleTag>
|
|
@@ -26,6 +26,7 @@ const {
|
|
|
26
26
|
publish_time,
|
|
27
27
|
hits,
|
|
28
28
|
title_tag,
|
|
29
|
+
title_class
|
|
29
30
|
} = Astro.props;
|
|
30
31
|
|
|
31
32
|
const TitleTag = title_tag || "div";
|
|
@@ -55,7 +56,7 @@ const date = render_date(siteinfo.language_id, publish_time, "DD");
|
|
|
55
56
|
<div class="tracking-widest text-sm title-font font-medium mb-1">
|
|
56
57
|
{category_name}
|
|
57
58
|
</div>
|
|
58
|
-
<TitleTag class="title-font text-2xl font-medium text-gray-900 mb-3">
|
|
59
|
+
<TitleTag class:list={["title-font text-2xl font-medium text-gray-900 mb-3", title_class]}>
|
|
59
60
|
<a href={render_url(node_url, base, null, url_suffix)} title={title}>{title}</a>
|
|
60
61
|
</TitleTag>
|
|
61
62
|
<p class="leading-relaxed mb-5">
|
|
@@ -39,6 +39,7 @@ const {
|
|
|
39
39
|
publish_time,
|
|
40
40
|
hits,
|
|
41
41
|
title_tag,
|
|
42
|
+
title_class,
|
|
42
43
|
always_show_img,
|
|
43
44
|
} = Astro.props;
|
|
44
45
|
|
|
@@ -80,7 +81,7 @@ const final_content = truncate(content, {
|
|
|
80
81
|
>{category_name}</a
|
|
81
82
|
>
|
|
82
83
|
</div>
|
|
83
|
-
<TitleTag class="h4 card-title">
|
|
84
|
+
<TitleTag class:list={["h4 card-title", title_class]}>
|
|
84
85
|
<a href={render_url(node_url, base, null, url_suffix)} title={title}>{title}</a>
|
|
85
86
|
</TitleTag>
|
|
86
87
|
<p>{final_content}</p>
|
|
@@ -26,6 +26,7 @@ const {
|
|
|
26
26
|
publish_time,
|
|
27
27
|
hits,
|
|
28
28
|
title_tag,
|
|
29
|
+
title_class
|
|
29
30
|
} = Astro.props;
|
|
30
31
|
|
|
31
32
|
const TitleTag = title_tag || "div";
|
|
@@ -48,7 +49,7 @@ const final_content = truncate(content, {
|
|
|
48
49
|
<div class="mb-3 text-sm text-[#6c757d]">{category_name}</div>
|
|
49
50
|
) : null
|
|
50
51
|
}
|
|
51
|
-
<TitleTag class="text-2xl mb-3">
|
|
52
|
+
<TitleTag class:list={["text-2xl mb-3", title_class]}>
|
|
52
53
|
<a href={render_url(node_url, base, null, url_suffix)} title={title}>{title}</a>
|
|
53
54
|
</TitleTag>
|
|
54
55
|
<div class="mb-3 text-sm text-[#666] leading-relaxed">
|
|
@@ -26,6 +26,7 @@ const {
|
|
|
26
26
|
publish_time,
|
|
27
27
|
hits,
|
|
28
28
|
title_tag,
|
|
29
|
+
title_class
|
|
29
30
|
} = Astro.props;
|
|
30
31
|
|
|
31
32
|
const TitleTag = title_tag || "div";
|
|
@@ -46,7 +47,7 @@ const final_content = truncate(content, {
|
|
|
46
47
|
>
|
|
47
48
|
</div>
|
|
48
49
|
<div class="md:flex-grow">
|
|
49
|
-
<TitleTag class="text-2xl font-medium text-gray-900 title-font mb-2">
|
|
50
|
+
<TitleTag class:list={["text-2xl font-medium text-gray-900 title-font mb-2", title_class]}>
|
|
50
51
|
<a href={render_url(node_url, base, null, url_suffix)} title={title}>{title}</a>
|
|
51
52
|
</TitleTag>
|
|
52
53
|
<p class="leading-relaxed">
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
import DefaultImage from "./default_image.astro";
|
|
20
20
|
import RenderImage from "./image.astro";
|
|
21
21
|
|
|
22
|
-
const { node, title_tag } = Astro.props;
|
|
22
|
+
const { node, title_tag, title_class } = Astro.props;
|
|
23
23
|
const { siteinfo, base, url_suffix } = Astro.locals;
|
|
24
24
|
|
|
25
25
|
const TitleTag = title_tag || "div";
|
|
@@ -67,7 +67,7 @@ if (render_value(node, "content")) {
|
|
|
67
67
|
}
|
|
68
68
|
</div>
|
|
69
69
|
<div class="mt-7">
|
|
70
|
-
<TitleTag class="text-center">
|
|
70
|
+
<TitleTag class:list={["text-center", title_class]}>
|
|
71
71
|
<a href={render_url(node.node_url, base, null, url_suffix)} title={node.node_title}
|
|
72
72
|
>{node.node_title}</a
|
|
73
73
|
>
|
|
@@ -22,6 +22,7 @@ const {
|
|
|
22
22
|
publish_time,
|
|
23
23
|
hits,
|
|
24
24
|
title_tag,
|
|
25
|
+
title_class
|
|
25
26
|
} = Astro.props;
|
|
26
27
|
|
|
27
28
|
const TitleTag = title_tag || "div";
|
|
@@ -39,7 +40,7 @@ const TitleTag = title_tag || "div";
|
|
|
39
40
|
</a>
|
|
40
41
|
|
|
41
42
|
<div class="text-[var(--themeColor)] mb-2">{category_name}</div>
|
|
42
|
-
<TitleTag class="mb-3">
|
|
43
|
+
<TitleTag class:list={["mb-3", title_class]}>
|
|
43
44
|
<a href={render_url(node_url, base, null, url_suffix)} title={title}>{title}</a>
|
|
44
45
|
</TitleTag>
|
|
45
46
|
<div class="flex items-center gap-3 text-[#6c757d] fill-[#6c757d] text-sm">
|
|
@@ -22,6 +22,7 @@ const {
|
|
|
22
22
|
original_price,
|
|
23
23
|
current_price,
|
|
24
24
|
title_tag,
|
|
25
|
+
title_class
|
|
25
26
|
} = Astro.props;
|
|
26
27
|
|
|
27
28
|
const { all_langs, base, url_suffix } = Astro.locals;
|
|
@@ -45,7 +46,7 @@ const RequestBtnText = render_value(all_langs, "request a quote");
|
|
|
45
46
|
|
|
46
47
|
<div class="p-3">
|
|
47
48
|
<TitleTag
|
|
48
|
-
class="my-2 text-[#222] hover:text-[#e53e3e] hover:underline"
|
|
49
|
+
class:list={["my-2 text-[#222] hover:text-[#e53e3e] hover:underline", title_class]}
|
|
49
50
|
>
|
|
50
51
|
<a href={render_url(node_url, base, null, url_suffix)} title={title} class="block text-center"
|
|
51
52
|
>{title}</a
|
|
@@ -6,7 +6,18 @@ export default defineToolbarApp({
|
|
|
6
6
|
// canvas.appendChild(text);
|
|
7
7
|
app.onToggled(async (options) => {
|
|
8
8
|
// 清除缓存
|
|
9
|
-
|
|
9
|
+
if(window.location.href.indexOf('preview.jeawin')){
|
|
10
|
+
// 是预览,第一段uri
|
|
11
|
+
// 获取路径部分
|
|
12
|
+
const path = window.location.pathname;
|
|
13
|
+
|
|
14
|
+
// 分割路径并获取第一段
|
|
15
|
+
const segments = path.split('/').filter(segment => segment.length > 0); // 过滤掉空字符串
|
|
16
|
+
const firstSegment = segments.length > 0 ? segments[0] : null;
|
|
17
|
+
await fetch(`/${firstSegment ? `${firstSegment}/` : ''}clear_cache`);
|
|
18
|
+
}else{
|
|
19
|
+
await fetch('/clear_cache');
|
|
20
|
+
}
|
|
10
21
|
alert('清除缓存成功');
|
|
11
22
|
|
|
12
23
|
});
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* @email chaegumi@jeawin.com
|
|
8
8
|
* @filesource
|
|
9
9
|
*/
|
|
10
|
+
import _ from 'lodash';
|
|
10
11
|
import {writeFile,mkdir} from "node:fs/promises";
|
|
11
12
|
import {fileURLToPath} from "node:url";
|
|
12
13
|
import {defineIntegration, addVirtualImports,createResolver} from "astro-integration-kit";
|
|
@@ -26,53 +27,55 @@ export default defineIntegration({
|
|
|
26
27
|
|
|
27
28
|
const {config, addMiddleware, injectRoute} = params;
|
|
28
29
|
|
|
30
|
+
const viteBase = _.get(config, ['vite.base'], '');
|
|
31
|
+
|
|
29
32
|
// addMiddleware({
|
|
30
33
|
// entrypoint: '',
|
|
31
34
|
// order:'pre'
|
|
32
35
|
// });
|
|
33
36
|
|
|
34
37
|
injectRoute({
|
|
35
|
-
pattern: '
|
|
38
|
+
pattern: `/${viteBase ? `${viteBase}/` : ''}robots.txt`,
|
|
36
39
|
entrypoint: resolve('./routes/robots.txt.ts'),
|
|
37
40
|
prerender: true
|
|
38
41
|
});
|
|
39
42
|
injectRoute({
|
|
40
|
-
pattern: '
|
|
43
|
+
pattern: `/${viteBase ? `${viteBase}/` : ''}clear_cache`,
|
|
41
44
|
entrypoint: resolve('./routes/clear_cache.ts'),
|
|
42
45
|
prerender: true
|
|
43
46
|
});
|
|
44
47
|
injectRoute({
|
|
45
|
-
pattern: '
|
|
48
|
+
pattern: `/${viteBase ? `${viteBase}/` : ''}manifest.json`,
|
|
46
49
|
entrypoint: resolve('./routes/manifest.json.ts'),
|
|
47
50
|
prerender: true
|
|
48
51
|
});
|
|
49
52
|
injectRoute({
|
|
50
|
-
pattern: '
|
|
53
|
+
pattern: `/${viteBase ? `${viteBase}/` : ''}opensearch.xml`,
|
|
51
54
|
entrypoint: resolve('./routes/opensearch.xml.ts'),
|
|
52
55
|
prerender: true
|
|
53
56
|
});
|
|
54
57
|
injectRoute({
|
|
55
|
-
pattern: '
|
|
58
|
+
pattern: `/${viteBase ? `${viteBase}/` : ''}rss.xml`,
|
|
56
59
|
entrypoint: resolve('./routes/rss.xml.ts'),
|
|
57
60
|
prerender: true
|
|
58
61
|
});
|
|
59
62
|
injectRoute({
|
|
60
|
-
pattern: '
|
|
63
|
+
pattern: `/${viteBase ? `${viteBase}/` : ''}site.webmanifest`,
|
|
61
64
|
entrypoint: resolve('./routes/site.webmanifest.ts'),
|
|
62
65
|
prerender: true
|
|
63
66
|
});
|
|
64
67
|
injectRoute({
|
|
65
|
-
pattern: '
|
|
68
|
+
pattern: `/${viteBase ? `${viteBase}/` : ''}sitemap.txt`,
|
|
66
69
|
entrypoint: resolve('./routes/sitemap.txt.ts'),
|
|
67
70
|
prerender: true
|
|
68
71
|
});
|
|
69
72
|
injectRoute({
|
|
70
|
-
pattern: '
|
|
73
|
+
pattern: `/${viteBase ? `${viteBase}/` : ''}sitemap.xml`,
|
|
71
74
|
entrypoint: resolve('./routes/sitemap.xml.ts'),
|
|
72
75
|
prerender: true
|
|
73
76
|
});
|
|
74
77
|
injectRoute({
|
|
75
|
-
pattern: '
|
|
78
|
+
pattern: `/${viteBase ? `${viteBase}/` : ''}sitemap.xsl`,
|
|
76
79
|
entrypoint: resolve('./routes/sitemap.xsl.ts'),
|
|
77
80
|
prerender: true
|
|
78
81
|
});
|
|
@@ -80,12 +83,12 @@ export default defineIntegration({
|
|
|
80
83
|
if(options?.amp){
|
|
81
84
|
// AMP需要的文件
|
|
82
85
|
injectRoute({
|
|
83
|
-
pattern: '
|
|
86
|
+
pattern: `/${viteBase ? `${viteBase}/` : ''}sw.js`,
|
|
84
87
|
entrypoint: resolve('./routes/sw.js.ts'),
|
|
85
88
|
prerender: true
|
|
86
89
|
});
|
|
87
90
|
injectRoute({
|
|
88
|
-
pattern: '
|
|
91
|
+
pattern: `/${viteBase ? `${viteBase}/` : ''}install_sw.html`,
|
|
89
92
|
entrypoint: resolve('./routes/install_sw.html.ts'),
|
|
90
93
|
prerender: true
|
|
91
94
|
});
|
|
@@ -93,12 +96,12 @@ export default defineIntegration({
|
|
|
93
96
|
|
|
94
97
|
// 谷歌验证文件
|
|
95
98
|
injectRoute({
|
|
96
|
-
pattern: '
|
|
99
|
+
pattern: `/${viteBase ? `${viteBase}/` : ''}google644a0e8e598e1092.html`,
|
|
97
100
|
entrypoint: resolve('./routes/google644a0e8e598e1092.html.ts'),
|
|
98
101
|
prerender: true
|
|
99
102
|
});
|
|
100
103
|
injectRoute({
|
|
101
|
-
pattern: '
|
|
104
|
+
pattern: `/${viteBase ? `${viteBase}/` : ''}googlef1564b538eef5383.html`,
|
|
102
105
|
entrypoint: resolve('./routes/googlef1564b538eef5383.html.ts'),
|
|
103
106
|
prerender: true
|
|
104
107
|
});
|