jsdelivr加速Github文件

jsdelivr加速Github文件

💡 原文中文,约700字,阅读约需2分钟。
📝

内容提要

本文介绍了如何通过将GitHub路径转换为jsdelivr路径来加速GitHub文件引用。提供了一个简单的Python函数,处理常见的路径格式问题。

🎯

关键要点

  • 使用jsdelivr可以加速GitHub文件引用。
  • GitHub路径格式为https://github.com/username/repo-name/path/to/file。
  • jsdelivr路径格式为https://cdn.jsdelivr.net/gh/username/repo-name/path/to/file。
  • 提供了一个Python函数来转换GitHub路径为jsdelivr路径。
  • 函数处理了常见的路径格式问题,如替换'/blob/'、'/main/'和'/master/'。
➡️

继续阅读