Skip to content

Commit

Permalink
Update: Remove redundant icon
Browse files Browse the repository at this point in the history
  • Loading branch information
AnyaReese committed Dec 14, 2024
1 parent 72339e2 commit 3ea99df
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 93 deletions.
6 changes: 1 addition & 5 deletions blog/first-blog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: first
slug: first-blog
title: Anya's first blog
date: 2024-12-14
tags: [anya, ZJU, Docusaurus, LifeHack, Tech]
# tags: [anya, ZJU, Docusaurus, LifeHack, Tech]
authors: AnyaReese
---

Expand All @@ -14,10 +14,6 @@ import LogoSwitcher from '@site/src/components/Logo/LogoSwitcher';

## AnyaReese Home Page

![GitHub last commit](https://img.shields.io/github/last-commit/anyareese/AnyaPage?label=update&logo=github)

![GitHub Action](https://img.shields.io/github/actions/workflow/status/anyareese/AnyaPage/ci.yml?label=CI%20Build&logo=github)

## 介绍

我是安假李四,这是我第一次接触 Docusaurus 和 react 项目,在不断学习的路上,plus est en vous: There's more in me(you).
Expand Down
2 changes: 1 addition & 1 deletion blog/sec-blog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: second
slug: sec-blog
title: Anya's second blog
date: 2024-12-14
tags: [anya, ZJU, Docusaurus, LifeHack, Tech]
# tags: [anya, ZJU, Docusaurus, LifeHack, Tech]
authors: AnyaReese
---

Expand Down
2 changes: 1 addition & 1 deletion docs/Artz/art.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
slug: art-display
title: 艺术作品展示
date: 2024-12-14
tags: []
# tags: []
authors: AnyaReese
---

Expand Down
2 changes: 1 addition & 1 deletion docs/Artz/sports.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
slug: sports
title: 飞盘赛事详情
date: 2024-12-14
tags: []
# tags: []
authors: AnyaReese
---

Expand Down
2 changes: 1 addition & 1 deletion docs/personal/resume.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
slug: resume
title: 个人简历
date: 2024-12-14
tags: []
# tags: []
authors: AnyaReese
---

Expand Down
2 changes: 1 addition & 1 deletion docs/personal/techexplore.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
slug: techexplore
title: 技术探索
date: 2024-12-14
tags: []
# tags: []
authors: AnyaReese
---

Expand Down
2 changes: 1 addition & 1 deletion docs/personal/whatonmymind.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
slug: daily
title: 随想
date: 2024-12-14
tags: []
# tags: []
authors: AnyaReese
---

Expand Down
10 changes: 5 additions & 5 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ const config = {
{
title: '博客',
items: [
{
label: '标签',
to: 'tags',
},
// {
// label: '标签',
// to: 'tags',
// },
{
label: '归档',
to: 'archive',
Expand All @@ -127,7 +127,7 @@ const config = {
items: [
{
label: '笔记',
to: 'docs/stack',
to: 'docs/Artz',
},
{
label: '项目',
Expand Down
4 changes: 0 additions & 4 deletions i18n/en/docusaurus-theme-classic/footer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
"message": "More",
"description": "The title of the footer links column with title=更多 in the footer"
},
"link.item.label.标签": {
"message": "Tags",
"description": "The label of footer link with label=标签 linking to tags"
},
"link.item.label.归档": {
"message": "Archive",
"description": "The label of footer link with label=归档 linking to archive"
Expand Down
8 changes: 0 additions & 8 deletions i18n/en/docusaurus-theme-classic/navbar.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@
"message": "Resume",
"description": "Navbar item with label 简历"
},
"item.label.标签": {
"message": "Tags",
"description": "Navbar item with label 标签"
},
"item.label.归档": {
"message": "Archive",
"description": "Navbar item with label 归档"
Expand All @@ -67,10 +63,6 @@
"message": "Notes",
"description": "Navbar item with label 笔记"
},
"item.label.学习栈": {
"message": "Stack",
"description": "Navbar item with label 学习栈"
},
"item.label.随笔": {
"message": "Lifestyle",
"description": "Navbar item with label 随笔"
Expand Down
24 changes: 0 additions & 24 deletions i18n/zh/code.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,30 +56,6 @@
"message":"博客",
"description": "blog"
},
"theme.tags.tagsPageTitle": {
"message": "标签",
"description": "The title of the tag list page"
},
"blogtagpage.title": {
"message": "下的博客",
"description": "blog tag page title"
},
"blogtagpage.title.alt": {
"message": "",
"description": "blog tag page title in alternate order"
},
"blogtagpage.description": {
"message": "博客标签",
"description": "blog tag page description"
},
"blogtagpage.count.label": {
"message": "",
"description": "blog page count label"
},
"blogtagpage.seeall.label": {
"message": "查看所有标签(分类)",
"description": "blog page see all label"
},
"theme.ErrorPageContent.title": {
"message": "页面已崩溃。",
"description": "The title of the fallback page when the page crashed"
Expand Down
6 changes: 1 addition & 5 deletions i18n/zh/docusaurus-theme-classic/navbar.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
{
"title": {
"message": "河山的技术存档",
"message": "Anya 的技术存档",
"description": "The title in the navbar"
},
"item.label.标签": {
"message": "标签",
"description": "Navbar item with label 标签"
},
"item.label.归档": {
"message": "归档",
"description": "Navbar item with label 归档"
Expand Down
45 changes: 9 additions & 36 deletions src/components/BlogInfo/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React from 'react'
import { usePluginData } from '@docusaurus/useGlobalData'
import type {
BlogTag,
BlogTags,
BlogPost,
} from '@docusaurus/plugin-content-blog'
import Link from '@docusaurus/Link'
Expand All @@ -16,7 +14,6 @@ import { projects } from '@site/data/project'

type Count = {
blog: number
tag: number
doc: number
project: number
}
Expand All @@ -35,11 +32,9 @@ export function BlogUser({ isNavbar = false }: { isNavbar?: boolean }) {
const docData = (usePluginData('docusaurus-plugin-content-docs') as any)
?.versions[0].docs
const blogData = blogPluginData?.blogs as BlogPost[]
const tagData = blogPluginData?.tags as BlogTags

const count: Count = {
blog: blogData.length,
tag: Object.keys(tagData).length ?? 0,
doc: docData?.length ?? 0,
project: projects?.length ?? 0,
}
Expand All @@ -62,11 +57,8 @@ export function BlogUser({ isNavbar = false }: { isNavbar?: boolean }) {
<Icon icon="carbon:blog" width="20" height="20" />
{count.blog}
</Link>
<Link className="bloginfo__num-item" href="/tags">
<Icon icon="ri:price-tag-3-line" width="20" height="20" />
{count.tag}
</Link>
<Link className="bloginfo__num-item" href="/docs/stack">
{/* 删除与 tag 相关的部分 */}
<Link className="bloginfo__num-item" href="/docs/Artz">
<Icon icon="carbon:notebook" width="20" height="20" />
{count.doc}
</Link>
Expand All @@ -91,29 +83,9 @@ export function BlogUser({ isNavbar = false }: { isNavbar?: boolean }) {
)
}

const TagsSection = ({ data }: { data: BlogTag[] }) => {
return (
<div className="bloginfo__tags">
{data
.filter(tag => tag != null)
.sort((a, b) => b.items.length - a.items.length)
.slice(0, 25)
.map(tag => (
<Link
className={`post__tags note__item margin-right--sm margin-bottom--sm`}
href={tag.permalink}
key={tag.permalink}
>
{tag.label}
</Link>
))}
</div>
)
}

export default function BlogInfo() {
const blogPluginData = usePluginData('docusaurus-plugin-content-blog') as any
const tagData = blogPluginData?.tags as BlogTags
const blogData = blogPluginData?.blogs as BlogPost[]

return (
<div className="bloginfo col col--3 margin-bottom--md">
Expand All @@ -124,11 +96,12 @@ export default function BlogInfo() {
</div>
<div className="bloghome__posts-card margin-bottom--md">
<div className="row bloginfo__card">
<div style={{ display: 'inline-flex', alignItems: 'center' }}>
<Icon icon="ri:price-tag-3-line" width="20" height="20" />
<span className="margin-horiz--sm">标签</span>
</div>
<TagsSection data={Object.values(tagData)} />
{/* 删除标签部分 */}
{/* <div style={{ display: 'inline-flex', alignItems: 'center' }}> */}
{/* <Icon icon="ri:price-tag-3-line" width="20" height="20" /> */}
{/* <span className="margin-horiz--sm">标签</span> */}
{/* </div> */}
{/* <TagsSection data={Object.values(tagData)} /> */}
</div>
</div>
</Fade>
Expand Down

0 comments on commit 3ea99df

Please sign in to comment.