diff --git a/docs/friends.md b/docs/friends.md index 91ccc15c..288e62d2 100644 --- a/docs/friends.md +++ b/docs/friends.md @@ -34,9 +34,50 @@ list: link: https://github.com/pengzhanbo avatar: https://github.com/pengzhanbo.png desc: 即使慢,驰而不息,纵会落后,纵会失败,但必须能够到达他所向的目标。 +groups: - - name: pengzhanbo - link: https://github.com/pengzhanbo - avatar: https://github.com/pengzhanbo.png - desc: 即使慢,驰而不息,纵会落后,纵会失败,但必须能够到达他所向的目标。 + title: 分组 1 + desc: 自定义颜色 + list: + - + name: pengzhanbo + link: https://github.com/pengzhanbo + avatar: https://github.com/pengzhanbo.png + desc: 即使慢,驰而不息,纵会落后,纵会失败,但必须能够到达他所向的目标。 + backgroundColor: rgb(255,153,0) + color: rgb(255,255,153) + nameColor: rgb(255,255,170) + borderColor: rgb(255,255,204) + - + name: pengzhanbo + link: https://github.com/pengzhanbo + avatar: https://github.com/pengzhanbo.png + desc: 即使慢,驰而不息,纵会落后,纵会失败,但必须能够到达他所向的目标。 + backgroundColor: rgb(255,102,102) + color: rgb(255,204,204) + nameColor: rgb(255,238,238) + borderColor: rgb(255,255,238) + - + name: pengzhanbo + link: https://github.com/pengzhanbo + avatar: https://github.com/pengzhanbo.png + desc: 即使慢,驰而不息,纵会落后,纵会失败,但必须能够到达他所向的目标。 + backgroundColor: rgb(0,153,204) + color: rgb(153,238,255) + nameColor: rgb(153,255,255) + borderColor: rgb(153,238,255) + - + title: 分组 2 + desc: 这里是分组 2 的描述文字 + list: + - + name: pengzhanbo + link: https://github.com/pengzhanbo + avatar: https://github.com/pengzhanbo.png + desc: 即使慢,驰而不息,纵会落后,纵会失败,但必须能够到达他所向的目标。 + - + name: pengzhanbo + link: https://github.com/pengzhanbo + avatar: https://github.com/pengzhanbo.png + desc: 即使慢,驰而不息,纵会落后,纵会失败,但必须能够到达他所向的目标。 --- diff --git a/docs/notes/theme/config/frontmatter/friend.md b/docs/notes/theme/config/frontmatter/friend.md index 70b87e4c..900192ce 100644 --- a/docs/notes/theme/config/frontmatter/friend.md +++ b/docs/notes/theme/config/frontmatter/friend.md @@ -71,5 +71,46 @@ interface FriendsItem { * 友情链接描述 */ desc?: string + + /** + * 背景色 + */ + backgroundColor?: string | { light: string, dark: string } + /** + * 字体颜色 + */ + color?: string | { light: string, dark: string } + /** + * 名字颜色 + */ + nameColor?: string | { light: string, dark: string } + /** + * 边框颜色 + */ + borderColor?: string | { light: string, dark: string } +} +``` + +### groups + +- 类型: `FriendsGroup[]` +- 默认值: `[]` + +友情链接分组 + +```ts +interface FriendsGroup { + /** + * 分组名 + */ + title?: string + /** + * 分组描述 + */ + desc?: string + /** + * 友情链接列表 + */ + list?: FriendsItem[] } ``` diff --git a/theme/src/client/components/Friends.vue b/theme/src/client/components/Friends.vue index 6f6ad277..b8f94639 100644 --- a/theme/src/client/components/Friends.vue +++ b/theme/src/client/components/Friends.vue @@ -5,11 +5,13 @@ import type { PlumeThemeFriendsFrontmatter } from '../../shared/index.js' import { useEditNavLink } from '../composables/index.js' import AutoLink from './AutoLink.vue' import FriendsItem from './FriendsItem.vue' +import FriendsGroup from './FriendsGroup.vue' const matter = usePageFrontmatter() const editNavLink = useEditNavLink() const list = computed(() => matter.value.list || []) +const groups = computed(() => matter.value.groups || [])