@coffic/cosy-ui 0.6.40 → 0.6.42

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.
@@ -202,6 +202,7 @@ const {
202
202
  author={metaConfig.author}
203
203
  robots={metaConfig.robots}
204
204
  head={metaConfig.head}
205
+ favicon={metaConfig.favicon}
205
206
  debug={debug}
206
207
  {...rest}>
207
208
  <ClientRouter />
@@ -50,7 +50,7 @@
50
50
  */
51
51
 
52
52
  import '../style.ts';
53
- import { LinkUtil, type IMetaProps } from '../index';
53
+ import { type IMetaProps } from '../index';
54
54
 
55
55
  export interface Props extends IMetaProps {
56
56
  debug?: boolean;
@@ -66,12 +66,12 @@ const {
66
66
  head,
67
67
  debug = true,
68
68
  class: className,
69
+ favicon,
69
70
  'class:list': classList,
70
71
  } = Astro.props;
71
72
 
72
73
  // 处理类名
73
74
  let bodyClasses = debug ? 'cosy:border cosy:border-red-500' : className || '';
74
- const faviconPath = LinkUtil.createUrl('/favicon.png');
75
75
  ---
76
76
 
77
77
  <!doctype html>
@@ -83,7 +83,7 @@ const faviconPath = LinkUtil.createUrl('/favicon.png');
83
83
  {description && <meta name="description" content={description} />}
84
84
  {keywords && <meta name="keywords" content={keywords} />}
85
85
  <meta name="generator" content={Astro.generator} />
86
- <link rel="icon" type="image/svg+xml" href={faviconPath} />
86
+ {favicon && <link rel="icon" type={favicon.format} href={favicon.src} />}
87
87
 
88
88
  <!-- 自定义样式 -->
89
89
  {customStyles && <style set:html={customStyles} />}
@@ -5,6 +5,11 @@ export interface IMetaProps {
5
5
  author: string;
6
6
  robots: string;
7
7
 
8
+ /**
9
+ * 图标
10
+ */
11
+ favicon?: ImageMetadata;
12
+
8
13
  /**
9
14
  * 基础路径,用于处理网站部署在二级目录的情况
10
15
  * @default ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coffic/cosy-ui",
3
- "version": "0.6.40",
3
+ "version": "0.6.42",
4
4
  "description": "An astro component library",
5
5
  "author": {
6
6
  "name": "nookery",