jeawin-astro 3.0.24 → 3.0.26

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.24",
3
+ "version": "3.0.26",
4
4
  "author": "chaegumi <chaegumi@qq.com>",
5
5
  "description": "",
6
6
  "license": "MIT",
@@ -12,17 +12,20 @@
12
12
  interface Props {
13
13
  block_title?: any;
14
14
  block_subtitle?: any;
15
+ h_tag_name?: any;
15
16
  }
16
- const { block_title, block_subtitle } = Astro.props;
17
+ const { block_title, block_subtitle, h_tag_name = 'h2' } = Astro.props;
18
+
19
+ const HTagName = h_tag_name;
17
20
  ---
18
21
 
19
22
  <div class="mb-8 lg:mb-16 relative z-[2]">
20
23
  <div
21
24
  class="text-4xl tracking-tight font-extrabold text-gray-900 text-center mb-4 flex flex-col gap-4 after:mx-auto after:w-1/12 after:border after:border-[var(--themeColor)]"
22
25
  >
23
- <h2>
26
+ <HTagName>
24
27
  <Fragment set:html={block_title} />
25
- </h2>
28
+ </HTagName>
26
29
  </div>
27
30
 
28
31
  <div
@@ -11,13 +11,16 @@
11
11
  */
12
12
  interface Props {
13
13
  block_title: any;
14
+ h_tag_name?: any;
14
15
  }
15
16
 
16
- const { block_title } = Astro.props;
17
+ const { block_title, h_tag_name } = Astro.props;
18
+
19
+ const HTagName = h_tag_name;
17
20
  ---
18
21
 
19
- <div
22
+ <HTagName
20
23
  class="text-2xl mb-7 flex flex-col gap-5 after:w-1/12 after:border after:border-[var(--themeColor)]"
21
24
  >
22
25
  {block_title}
23
- </div>
26
+ </HTagName>
@@ -2,14 +2,16 @@
2
2
  interface Props {
3
3
  block_title: any;
4
4
  block_subtitle?: any;
5
+ h_tag_name?: any;
5
6
  }
6
- const { block_title, block_subtitle } = Astro.props;
7
+ const { block_title, block_subtitle, h_tag_name = 'h2' } = Astro.props;
8
+ const HTagName = h_tag_name;
7
9
  ---
8
10
 
9
11
  <div class="mx-auto max-w-screen-sm text-center mb-8 lg:mb-16">
10
- <h2 class="mb-4 text-4xl tracking-tight font-extrabold text-gray-900">
12
+ <HTagName class="mb-4 text-4xl tracking-tight font-extrabold text-gray-900">
11
13
  {block_title}
12
- </h2>
14
+ </HTagName>
13
15
  <p class="font-light text-gray-500 lg:mb-16 sm:text-xl">
14
16
  {block_subtitle}
15
17
  </p>
@@ -11,6 +11,8 @@
11
11
  import { render_value } from "../scripts/util.js";
12
12
  import Input from "./formitem/input.astro";
13
13
  const { btn_class, siteinfo, jeawin_form_api_domain, all_langs } = Astro.locals;
14
+
15
+ const {other_btn_class} = Astro.props;
14
16
  ---
15
17
 
16
18
  <form
@@ -38,7 +40,7 @@ const { btn_class, siteinfo, jeawin_form_api_domain, all_langs } = Astro.locals;
38
40
  <button
39
41
  type="submit"
40
42
  id="submitbtnsubscribe"
41
- class:list={["break-keep", ...btn_class]}
43
+ class:list={["break-keep", ...btn_class, other_btn_class ? other_btn_class : null]}
42
44
  >{render_value(all_langs, "Subscribe")}</button
43
45
  >
44
46
  </div>
@@ -1,13 +1,17 @@
1
1
  ---
2
2
  import { Icon } from "astro-icon/components";
3
3
  import { render_value } from "../scripts/util.js";
4
+ interface Props {
5
+ show_search_box?: boolean;
6
+ }
4
7
  const { all_langs } = Astro.locals;
8
+ const {show_search_box = false} = Astro.props;
5
9
  const searchInputLang = render_value(all_langs, "Search by site");
6
10
  const searchLang = render_value(all_langs, "Search");
7
11
  ---
8
12
 
9
13
  <div>
10
- <div x-data="{showSearchForm:false}" class="w-full" :class={`{'w-full':showSearchForm}`}>
14
+ <div x-data={`{showSearchForm:${show_search_box}}`} class="w-full" :class={`{'w-full':showSearchForm}`}>
11
15
  <Icon
12
16
  name="fa6-solid:magnifying-glass"
13
17
  class="md:hidden size-5"
@@ -21,7 +21,7 @@ export const GET:APIRoute = async ({site, locals}) => {
21
21
  title: node.node_title,
22
22
  pubDate: dayjs.unix(node.node_created).format('YYYY-MM-DD HH:mm:ss'),
23
23
  description: node.content,
24
- link: render_url(node.node_uri, locals.base, null, locals.url_suffix)
24
+ link: render_url(node.node_url, locals.base, null, locals.url_suffix)
25
25
  })
26
26
  })
27
27
 
@@ -1,40 +1,44 @@
1
- /**
2
- * 判断是不是默认图片
3
- */
4
- export function is_default_image(img_url: any): boolean;
5
- /**
6
- * 输出发布时间
7
- */
8
- export function render_date(locale: string, t: any, f?: string): any;
9
- /**
10
- * 安全输出数据
11
- */
12
- export function render_value(obj: any, prop: any, def?: string): any;
13
- /**
14
- * 输出url
15
- */
16
- export function render_url(url: any, base?: string, queryObj?: any, suffix?: any): any;
17
- /**
18
- * 输出url
19
- */
20
- export function get_url(apikey: any, page_type: any, id: any): Promise<string>;
21
- /**
22
- * 图片添加链接
23
- */
24
- export function img_add_link(img_html: any): any;
25
- /**
26
- * 图片修改属性
27
- */
28
- export function img_change_attrs(img_html: any, add_attrs: any, remove_attrs: any): any;
29
- /**
30
- * 返回子类别
31
- */
32
- export function get_children_categories(all_categories: any, channel_id: any, category_id: any, is_check?: boolean): any;
33
- /**
34
- * 截取html
35
- */
36
- export function truncate(content: any, options: any): any;
37
- /**
38
- * 判断是否使用pagefind搜索
39
- */
40
- export function is_pagefind(language_id: any): boolean;
1
+ /**
2
+ * 判断是不是默认图片
3
+ */
4
+ export function is_default_image(img_url: any): boolean;
5
+ /**
6
+ * 输出发布时间
7
+ */
8
+ export function render_date(locale: string, t: any, f?: string): any;
9
+ /**
10
+ * 安全输出数据
11
+ */
12
+ export function render_value(obj: any, prop: any, def?: string): any;
13
+ /**
14
+ * 输出url
15
+ */
16
+ export function render_url(url: any, base?: string, queryObj?: any, suffix?: string): any;
17
+ /**
18
+ * 输出url
19
+ */
20
+ export function get_url(apikey: any, page_type: any, id: any): Promise<string>;
21
+ /**
22
+ * 图片添加链接
23
+ */
24
+ export function img_add_link(img_html: any): any;
25
+ /**
26
+ * 图片修改属性
27
+ */
28
+ export function img_change_attrs(img_html: any, add_attrs: any, remove_attrs: any): any;
29
+ /**
30
+ * 返回子类别
31
+ */
32
+ export function get_children_categories(all_categories: any, channel_id: any, category_id: any, is_check?: boolean): any;
33
+ /**
34
+ * 截取html
35
+ */
36
+ export function truncate(content: any, options: any): any;
37
+ /**
38
+ * 判断是否使用pagefind搜索
39
+ */
40
+ export function is_pagefind(language_id: any): boolean;
41
+ /**
42
+ * 输出多语言项
43
+ */
44
+ export function render_lang(all_langs: any, key: any): any;
@@ -343,4 +343,11 @@ export function is_pagefind(language_id) {
343
343
  return false;
344
344
  }
345
345
  return true;
346
+ }
347
+
348
+ /**
349
+ * 输出多语言项
350
+ */
351
+ export function render_lang(all_langs, key){
352
+ return render_value(all_langs, key, key);
346
353
  }