Comments (7)
如果文件比较多,直接用脚本改方便多了,改成 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)
from picx.
已解决图片失效的问题,给作者点个赞!
from picx.
为啥更换链接之后,部署dist之后图片都打不开了?在本地typora是可以看到图片的。
from picx.
为啥更换链接之后,部署dist之后图片都打不开了?在本地typora是可以看到图片的。
@cmty256
没看明白,请描述清楚,并附带截图。你原来用的是哪中图片链接规则,更换成哪种?
from picx.
为啥更换链接之后,部署dist之后图片都打不开了?在本地typora是可以看到图片的。
@cmty256 没看明白,请描述清楚,并附带截图。你原来用的是哪中图片链接规则,更换成哪种?
就我把那三种链接规则都换成了ChinaJsDelivr,然后部署项目github page之后浏览器打开网站就看不到图片了,但是我本地的md文件是可以看到图片的。
from picx.
这种情况作者也不清楚,正常来说,你的图片链接能不能正常访问,只跟你网络环境有关。
建议你把图床部署到 GitHub Pages,然后把图片链接规则替换成 GitHub Pages
from picx.
@cmty256
另外,遇到问题,不要在此 Issue 评论,请新开 Issue。
from picx.
Related Issues (20)
- 大写字母文件格式支持 HOT 1
- ⚠️ ⚠️ 重要公告,必读 🚥🚥 HOT 5
- 建议上传时重命名直接用哈希值以及日期目录可以自定义 HOT 1
- “在线使用入口”支持自行部署吗? HOT 1
- 有API接口文档吗 HOT 2
- 侧边栏收起/展开的 trigger,在切换过程中位置发生了变化 HOT 1
- GitHub Page模式下图片链接同步性问题
- login and use on mobiles HOT 5
- images with .ico suffix is not listed
- 复制图片链接没反应!!!!! HOT 2
- 这个图床上传后最终图片去了哪里? HOT 2
- 这个图床上传后最终图片去了哪里?
- 这个可以我自行部署吗 HOT 1
- 复制图片地址控制台+报错 HOT 1
- 图片文件列表加载时间过长 HOT 3
- 后续会开发基于Gitee API的功能吗?国内访问有限制 HOT 1
- 希望在自定义链接中新增自动增加版本号 HOT 1
- Typora上传服务 HOT 1
- [功能建议]水印功能能否增加一个全屏水印 HOT 1
- 复制不了,也不会弹窗提示,文件传上去了 HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from picx.