From a3208fc3098df5cc58fc170b7982c4d3c6ae47bf Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Wed, 30 Apr 2025 09:08:51 +0800 Subject: [PATCH] feat(theme): add comment and markdown content into friends page (#580) --- docs/notes/theme/config/frontmatter/friend.md | 7 +++++++ docs/notes/theme/guide/features/friend-links.md | 5 ++++- theme/src/client/components/VPComment.vue | 15 +++++++++++++++ theme/src/client/components/VPDoc.vue | 13 +++++-------- theme/src/client/components/VPFriends.vue | 11 +++++++++++ theme/src/shared/frontmatter/friends.ts | 4 ++++ 6 files changed, 46 insertions(+), 9 deletions(-) create mode 100644 theme/src/client/components/VPComment.vue diff --git a/docs/notes/theme/config/frontmatter/friend.md b/docs/notes/theme/config/frontmatter/friend.md index c4422a3d..9cf982e2 100644 --- a/docs/notes/theme/config/frontmatter/friend.md +++ b/docs/notes/theme/config/frontmatter/friend.md @@ -62,6 +62,13 @@ list: 友情链接页的描述 +### contentPosition + +- 类型: `'before' | 'after'` +- 默认值: `'after'` + +markdown 内容在友情链接列表之前还是之后,默认插入到列表之后。 + ### list - 类型: `FriendsItem[]` diff --git a/docs/notes/theme/guide/features/friend-links.md b/docs/notes/theme/guide/features/friend-links.md index c5c3ae4c..cba45b93 100644 --- a/docs/notes/theme/guide/features/friend-links.md +++ b/docs/notes/theme/guide/features/friend-links.md @@ -18,6 +18,7 @@ friends: true title: 友情链接 description: 友情链接描述文本 permalink: /friends/ +contentPosition: after list: - name: pengzhanbo @@ -30,9 +31,11 @@ list: avatar: https://github.com/pengzhanbo.png desc: 即使慢,驰而不息,纵会落后,纵会失败,但必须能够到达他所向的目标。 --- + +自定义内容 ``` -主题会根据 配置信息 生成友情链接页。 如果未配置 `permalink` ,默认为 `/friends/`。 +主题会根据 配置信息 生成友情链接页。 你需要自行将 友情链接页 的入口链接 配置到 `navbar` 的合适的位置中。 diff --git a/theme/src/client/components/VPComment.vue b/theme/src/client/components/VPComment.vue new file mode 100644 index 00000000..ae521651 --- /dev/null +++ b/theme/src/client/components/VPComment.vue @@ -0,0 +1,15 @@ + + + diff --git a/theme/src/client/components/VPDoc.vue b/theme/src/client/components/VPDoc.vue index 3ac558fc..bc4efd0a 100644 --- a/theme/src/client/components/VPDoc.vue +++ b/theme/src/client/components/VPDoc.vue @@ -1,4 +1,5 @@