Skip to content

Commit

Permalink
feat: use jsdelivr CDN
Browse files Browse the repository at this point in the history
  • Loading branch information
SharerMax committed Dec 11, 2023
1 parent 444f16d commit 6f8dd0e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"eslint.experimental.useFlatConfig": true,
"eslint.format.enable": true,
"editor.codeActionsOnSave": {
"source.fixAll": true
"source.fixAll": "explicit"
}
}
8 changes: 7 additions & 1 deletion src/ejs/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@
margin: 0 0 8px;
}
.header-wrapper .gh-icon {
height: 1em;
vertical-align: middle;
margin-bottom: 5px;
}
.header-wrapper h1 {
margin: 0;
}
Expand Down Expand Up @@ -94,7 +100,7 @@
<div>
<div class="container">
<div class="header-wrapper">
<h1>Rules List</h1>
<h1>Rules List <a href="https://github.com/SharerMax/V2ray2ClashRule" target="_blank" rel="noopener"><img class="gh-icon" alt="Github-V2ray2ClashRule"src="https://img.shields.io/badge/Star-black?logo=github" crossorigin="anonymous"></a> </h1>
<p class="brief">Convert <a href="https://github.com/v2fly/domain-list-community" target="_blank">v2ray domain list</a> rule to clash rule</p>
</div>
<div>Latest update: <%= latestUpdateDate %></div>
Expand Down
5 changes: 3 additions & 2 deletions src/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import ejs from 'ejs'

const __dirname = path.dirname(fileURLToPath(import.meta.url))
const publicDir = path.resolve(__dirname, '../public')
const RAW_HOST = 'https://raw.githubusercontent.com'
// const RAW_BASE_URL = 'https://raw.githubusercontent.com/SharerMax/V2ray2ClashRule/release'
const RAW_BASE_URL = 'https://cdn.jsdelivr.net/gh/SharerMax/V2ray2ClashRule@release'

async function generateRuleList(rulesSourceDir: string) {
const fileList = await fs.readdir(rulesSourceDir)
return fileList.map(file => ({
name: file,
url: `${RAW_HOST}/SharerMax/V2ray2ClashRule/release/${file}`,
url: `${RAW_BASE_URL}/${file}`,
}))
}

Expand Down

0 comments on commit 6f8dd0e

Please sign in to comment.