Skip to content
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

原来的markdown能无缝切换图床吗 #29

Closed
bhpike65 opened this issue Apr 3, 2016 · 9 comments
Closed

原来的markdown能无缝切换图床吗 #29

bhpike65 opened this issue Apr 3, 2016 · 9 comments

Comments

@bhpike65
Copy link

bhpike65 commented Apr 3, 2016

还是一定要改文章使用qnimg标签
能否增加无缝切换图床的功能,把文章里所有的图片标签都使用七牛来存?
或者自动把图片挂到子域名下, 然后把子域名cname到七牛上?

@gyk001
Copy link
Owner

gyk001 commented May 26, 2016

直接批量替换怕是不靠谱,不过可以考虑做一个迁移工具,欢迎一起讨论

@gavinliu
Copy link

gavinliu commented Aug 9, 2016

为何不兼容 markdown 语法呢?

{% qnimg test/demo.png title:图片标题 alt:图片说明 'class:class1 class2' extend:?imageView2/2/w/600 %}

定义的这些参数都用不到,我只需要把 ![title](/images/x.png) 渲染成 <img title='title' src='qiniu cdn url' /> 且同时上传图片到七牛的

@bhpike65
Copy link
Author

@gavinliu 我现在是自己上传到七牛,然后配个nginx rewrite规则302重定向到七牛

@gyk001
Copy link
Owner

gyk001 commented Aug 10, 2016

@gavinliu hexo插件从正常机制上是不参与markdown解析的,只能处理这种{% xxxx %}扩展功能,所以暂时不知道技术上能不能到你期望的结果。有时间可以研究一下

@gyk001
Copy link
Owner

gyk001 commented Aug 10, 2016

可以用插件自动上传七牛,然后nginx 做链接重定向 @bhpike65

@zhangnew
Copy link

如果有非入侵方式就好了

@atjason
Copy link

atjason commented Dec 1, 2016

感觉用个工具、做最实在的搬家,最根本的解决问题:

  • 遍历本地需要搬家的 Markdown 文件
  • 找到 Markdown 文件中的图片链接
  • 将图片上传至七牛(或别的图床)
  • 更新 Markdown 文件中的图片链接

比如像 Nginx 重定向这种方法对很多朋友还是有门槛的,而操作 Markdown 文件倒是难度低很多。我倒是有心在 iPic 中做这个功能(因为最近升级 https 需要对图床搬家),但总感觉需求太小,下不去手。

@bhpike65
Copy link
Author

bhpike65 commented Dec 1, 2016

终结此问题

  1. 全站cname到七牛, nginx基本不用配置,如果开启watermark等扩展则需要rewrite
  2. 静态资源分配独立子域名,子域名cname到七牛,则需要rewite到子域名
  3. 不使用cname,就需要rewrite到七牛的提供的地址上

这个插件就用来作为同步上传工具,还是不错的, 主要就是目前七牛使用cname功能要充值10rmb

@bhpike65 bhpike65 closed this as completed Dec 1, 2016
@atjason
Copy link

atjason commented Dec 8, 2016

@bhpike65 @gyk001 可以试试图床搬家神器 iPic Mover,可以一键将 Markdown 中的图片从一个图床搬到另一个图床。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants