Skip to content

Commit 0a0acc1

Browse files
committed
feat: update tags
1 parent e2863b2 commit 0a0acc1

File tree

6 files changed

+22
-5
lines changed

6 files changed

+22
-5
lines changed

docs/主题/自定义主题.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: 自定义主题
33
abbrlink: 9f41fc98
44
date: 2019-05-12 13:23:44
5+
tags: ['主题', '自定义标签1']
56
-->
67

78
## 使用自定义主题

docs/书写组件.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<!--
22
abbrlink: lx1euo1b
3+
tags: ['组件']
34
-->
45

56
import { Button } from '../components/index.jsx'

docs/测试/测试路由.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
* 该页面用来测试未使用 abbrlink 的中文路径。
1+
<!--
2+
tags: ['自定义标签1']
3+
-->
4+
5+
* 该页面用来测试未使用 abbrlink 的中文路径。

packages/crd-seed/component/Header/index.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { useState } from 'react'
2-
import classNames from 'classnames'
2+
import cx from 'classnames'
33
import { Link } from 'react-router-dom'
44
import Switch from 'react-switch'
5+
import { ifProd } from 'crd-client-utils'
56
import { isMobile } from '../../utils'
67
import Search from '../Search'
78
import styles from './index.less'
@@ -20,7 +21,7 @@ const Header = ({
2021
setChecked(value)
2122
}
2223
return (
23-
<div className={classNames(styles.header, className)}>
24+
<div className={cx(styles.header, className)}>
2425
<div className={styles.wrapper}>
2526
<Link to="/" replace className={styles.titleLink}>
2627
<div className={styles.logo}>
@@ -35,6 +36,12 @@ const Header = ({
3536
{DOCSCONFIG && DOCSCONFIG.search ? <Search className={styles.search} /> : null}
3637
</div>
3738
<div className={styles.rightArea}>
39+
<Link
40+
className={styles['tags']}
41+
to={ifProd ? `/${repo}/tags` : '/tags'}
42+
>
43+
标签
44+
</Link>
3845
<Switch
3946
className={styles['no-dark-mode']}
4047
onChange={handleChange}

packages/crd-seed/component/Header/index.less

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@
8181
}
8282
}
8383

84+
.tags {
85+
font-size: 15px;
86+
margin-right: 16px;
87+
}
88+
8489
@keyframes octocat-wave {
8590
0%, 100% {
8691
transform: rotate(0);

packages/crd-seed/component/Tags/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ const Tags = ({ name }) => {
1414
? mapTagsWithArticle.find(({ tagName }) => tagName === name)?.mapArticle.map(({ path, title }) => {
1515
return <Link
1616
className={styles['tags-text']}
17-
// todo
18-
to={ifProd ? `/${repo}/${path}` : `/${path}`}
17+
to={ifProd ? `/${repo}${path}` : `${path}`}
1918
key={title}
2019
>
2120
{title}

0 commit comments

Comments
 (0)