Skip to content

Commit 528105c

Browse files
committed
fix: #205
1 parent 0becb1d commit 528105c

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

docs/更新日志.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ abbrlink: 179nqpxt
66

77
`create-react-doc` 严格遵循 [Semantic Versioning 2.0.0](http://semver.org/lang/zh-CN/) 语义化版本规范。
88

9+
### 1.5.2
10+
11+
`2021-10-19`
12+
13+
- **Fix**
14+
15+
- 🐞 修复点击右上角 `Edit in GitHub` 链接跳转错误的问题。[issue](https://github.com/MuYunyun/create-react-doc/issues/205)
16+
917
### 1.5.1
1018

1119
`2021-10-19`

packages/crd-seed/layout/index.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,23 +136,18 @@ function BasicLayout({
136136
* such as edit in github and so on.
137137
*/
138138
const renderPageHeader = () => {
139-
console.log('routeData', routeData)
140-
console.log('menuSource', menuSource)
141139
const curMenuSource = routeData.filter(r => {
142140
if (r.props.type === 'directory') return false
143141
return pathname.indexOf(r.mdconf.abbrlink) > -1 || decodeURIComponent(pathname).indexOf(r.path) > -1
144142
})
145-
const editPathName = curMenuSource[0] && curMenuSource[0].path
146-
console.log('curMenuSource', curMenuSource)
147-
console.log('a link', `https://github.com/${user}/${repo
148-
}/edit/${branch}${editPathName}.md`)
143+
const editPathName = curMenuSource[0] && curMenuSource[0].props.path
149144
return (
150145
<div className={cx(styles.pageHeader)}>
151146
{user && repo ? (
152147
<a
153148
href={`https://github.com/${user}/${
154149
repo
155-
}/edit/${branch}${editPathName}.md`}
150+
}/edit/${branch}${editPathName}`}
156151
target="_blank"
157152
>
158153
<Icon className={cx(styles.icon)} type="edit" size={13} />

0 commit comments

Comments
 (0)