Skip to content

Commit

Permalink
🐛 fix: 修正 title 无法替换的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Feb 14, 2023
1 parent 9e3837d commit e5fe591
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/store/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,20 @@ export const apiHeaderSel = (s: SiteStore): ApiHeader => {
const sourceUrl =
sourceUrlMatch === false || typeof sourceUrlMatch === 'undefined' || !fm.atomId
? undefined
: sourceUrlMatch.replace('{github}', REPO_BASE).replace('{atomId}', fm.atomId);
: sourceUrlMatch
.replace('{github}', REPO_BASE)
.replace('{atomId}', fm.atomId)
.replace('{title}', fm.title);

const docUrl =
docUrlMatch === false || typeof docUrlMatch === 'undefined' || !fm.atomId
? undefined
: docUrlMatch
.replace('{github}', REPO_BASE)
.replace('{atomId}', fm.atomId)
.replace('{title}', fm.title)
.replace('{locale}', localeId);

console.log(docUrl);
return { pkg, sourceUrl, docUrl };
};

Expand Down

1 comment on commit e5fe591

@vercel
Copy link

@vercel vercel bot commented on e5fe591 Feb 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.