Skip to content

Commit 12d80f6

Browse files
committed
fix:Link target of repo's GitHub Corner according to externalLinkTarget config. #835
1 parent 676f84c commit 12d80f6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: src/core/render/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ export function initRender(vm) {
226226

227227
if (el) {
228228
if (config.repo) {
229-
html += tpl.corner(config.repo)
229+
html += tpl.corner(config.repo, config.externalLinkTarget)
230230
}
231231
if (config.coverpage) {
232232
html += tpl.cover()

Diff for: src/core/render/tpl.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {isMobile} from '../util/env'
44
* @param {Object} data
55
* @return {String}
66
*/
7-
export function corner(data) {
7+
export function corner(data, externalLinkTarget) {
88
if (!data) {
99
return ''
1010
}
@@ -14,7 +14,7 @@ export function corner(data) {
1414
data = data.replace(/^git\+/, '')
1515

1616
return (
17-
`<a href="${data}" class="github-corner" aria-label="View source on Github">` +
17+
`<a href="${data}" target="${externalLinkTarget}" class="github-corner" aria-label="View source on Github">` +
1818
'<svg viewBox="0 0 250 250" aria-hidden="true">' +
1919
'<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>' +
2020
'<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>' +

0 commit comments

Comments
 (0)