Skip to content

Commit

Permalink
feat: support jsDelivr CDN to speedup static files (#668)
Browse files Browse the repository at this point in the history
  • Loading branch information
juzhiyuan authored Oct 21, 2021
1 parent e30db35 commit 86a5a63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/sync-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ const replaceMDElements = (project, path, branch = "master") => {
from: /(\.\.\/)+assets\/images\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/g,
to: (match) => {
const imgPath = match.replace(/\(|\)|\.\.\/*/g, "");
const newUrl = `https://raw.githubusercontent.com/apache/${project}/${branch}/docs/${imgPath}`;
const newUrl = `https://cdn.jsdelivr.net/gh/apache/${project}@${branch}/docs/${imgPath}`;
//console.log(`${project}: ${match} 👉 ${newUrl}`);
return newUrl;
},
Expand Down

0 comments on commit 86a5a63

Please sign in to comment.