Skip to content

Commit

Permalink
fix:Link target of repo's GitHub Corner according to externalLinkTarg…
Browse files Browse the repository at this point in the history
…et config. #835
  • Loading branch information
Koooooo-7 committed May 10, 2019
1 parent 676f84c commit 12d80f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/core/render/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export function initRender(vm) {

if (el) {
if (config.repo) {
html += tpl.corner(config.repo)
html += tpl.corner(config.repo, config.externalLinkTarget)
}
if (config.coverpage) {
html += tpl.cover()
Expand Down
4 changes: 2 additions & 2 deletions src/core/render/tpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {isMobile} from '../util/env'
* @param {Object} data
* @return {String}
*/
export function corner(data) {
export function corner(data, externalLinkTarget) {
if (!data) {
return ''
}
Expand All @@ -14,7 +14,7 @@ export function corner(data) {
data = data.replace(/^git\+/, '')

return (
`<a href="${data}" class="github-corner" aria-label="View source on Github">` +
`<a href="${data}" target="${externalLinkTarget}" class="github-corner" aria-label="View source on Github">` +
'<svg viewBox="0 0 250 250" aria-hidden="true">' +
'<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>' +
'<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>' +
Expand Down

0 comments on commit 12d80f6

Please sign in to comment.