fix: cornerExternalLinkTarget config. (#1814)

This commit is contained in:
Koy Zhuang 2022-06-04 23:16:52 +08:00 committed by GitHub
parent fa14210e8e
commit 54cc5f939b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -413,7 +413,7 @@ export function Render(Base) {
if (el) {
if (config.repo) {
html += tpl.corner(config.repo, config.cornerExternalLinkTarge);
html += tpl.corner(config.repo, config.cornerExternalLinkTarget);
}
if (config.coverpage) {

View File

@ -1,10 +1,10 @@
/**
* Render github corner
* @param {Object} data URL for the View Source on Github link
* @param {String} cornerExternalLinkTarge value of the target attribute of the link
* @param {String} cornerExternalLinkTarget value of the target attribute of the link
* @return {String} SVG element as string
*/
export function corner(data, cornerExternalLinkTarge) {
export function corner(data, cornerExternalLinkTarget) {
if (!data) {
return '';
}
@ -15,10 +15,10 @@ export function corner(data, cornerExternalLinkTarge) {
data = data.replace(/^git\+/, '');
// Double check
cornerExternalLinkTarge = cornerExternalLinkTarge || '_blank';
cornerExternalLinkTarget = cornerExternalLinkTarget || '_blank';
return (
`<a href="${data}" target="${cornerExternalLinkTarge}" class="github-corner" aria-label="View source on Github">` +
`<a href="${data}" target="${cornerExternalLinkTarget}" 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>' +