Skip to content

Commit

Permalink
fix(github): 🐛 wrong github link of 'view on github'
Browse files Browse the repository at this point in the history
  • Loading branch information
Timothy-Liuxf committed May 16, 2024
1 parent eba2ebe commit cf3531c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,13 @@

const viewOnGitHub = () => {
if (is_main_page) {
window.location.href = base_url + '/';
window.location.href = repo_url + '/';
} else {
let target = `${repo_url}/blob/${repo_branch}/${repo_path.replace(/\/$/, '')}${current_url.slice(base_url.length)}`;
let target = `${repo_url}/blob/${repo_branch}/${repo_path.replace(/\/$/, '')}`;
if (!target.endsWith('/')) {
target += '/';
}
target += current_url.slice(base_url.length + 1);
if (target.endsWith('/')) {
target += 'README.md';
} else if (target.endsWith('.html')) {
Expand Down

0 comments on commit cf3531c

Please sign in to comment.