-
-
Notifications
You must be signed in to change notification settings - Fork 427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
📢 必读公告 #261
Comments
如果文件比较多,直接用脚本改方便多了,改成 github 的一劳永逸 😆 import re
import os
owner = ''
repo = ''
branch = ''
github = f'github.com/{owner}/{repo}/raw/{branch}'
staticaly = f'cdn.staticaly.com/gh/{owner}/{repo}@{branch}'
chinaJsDelivr = f'jsd.cdn.zzko.cn/gh/{owner}/{repo}@{branch}'
jsDelivr = f'cdn.jsdelivr.net/gh/{owner}/{repo}@{branch}'
basepath = ''
def redistribution(basepath):
for root, dirs, files in os.walk(basepath):
for file in files:
if file and os.path.splitext(file)[-1] == '.md':
filename = os.path.join(root, file)
with open(filename) as f:
d = re.sub(f'{staticaly}', f'{github}', f.read())
d = re.sub(f'{chinaJsDelivr}', f'{github}', d)
d = re.sub(f'{jsDelivr}', f'{github}', d)
with open(filename, 'w') as f:
f.write(d)
if __name__ == '__main__':
redistribution(basepath) |
已解决图片失效的问题,给作者点个赞! |
为啥更换链接之后,部署dist之后图片都打不开了?在本地typora是可以看到图片的。 |
@cmty256 |
就我把那三种链接规则都换成了ChinaJsDelivr,然后部署项目github page之后浏览器打开网站就看不到图片了,但是我本地的md文件是可以看到图片的。 |
这种情况作者也不清楚,正常来说,你的图片链接能不能正常访问,只跟你网络环境有关。 |
@cmty256 |
https://cdn.staticaly.com
已经无法使用。https://cdn.statically.io
,但是在中国大陆地区无法使用,需要 FQ。Statically
、jsDelivr
、GitHub
这三种图片链接规则,均需要 FQ 才能访问。ChinaJsDelivr
。https://cdn.staticaly.com/gh/
->https://cdn.statically.io/gh/
(需要翻墙访问)https://cdn.staticaly.com/gh/
->https://jsd.cdn.zzko.cn/gh/
(无需翻墙访问)The text was updated successfully, but these errors were encountered: