Skip to content

Commit

Permalink
新增功能:适配skills.github.com
Browse files Browse the repository at this point in the history
  • Loading branch information
maboloshi committed Jun 8, 2024
1 parent 5795999 commit 439bf92
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// @match https://github.com/*
// @match https://gist.github.com/*
// @match https://www.githubstatus.com/*
// @match https://skills.github.com
// @require https://raw.githubusercontent.com/maboloshi/github-chinese/gh-pages/locals.js?v1.9.0
// @run-at document-end
// @grant GM_xmlhttpRequest
Expand Down Expand Up @@ -183,7 +184,8 @@
// 站点,如 gist, developer, help 等,默认主站是 github
const siteMapping = {
'gist.github.com': 'gist',
'www.githubstatus.com': 'status'
'www.githubstatus.com': 'status',
'skills.github.com': 'skills'
};
const site = siteMapping[location.hostname] || 'github'; // 站点
const pathname = location.pathname; // 当前路径
Expand Down Expand Up @@ -215,6 +217,8 @@
page = 'gist';
} else if (site === 'status') { // GitHub Status 页面
page = 'status';
} else if (site === 'skills') { // GitHub Skills 页面
page = 'skills';
} else if (pathname === '/' && site === 'github') { // github.com 首页
page = isLogin ? 'page-dashboard' : 'homepage';
} else if (isRepository) { // 仓库页
Expand Down

0 comments on commit 439bf92

Please sign in to comment.