[英]Pelican external image in restructured text
我想把外部图像放在我用Pelican创建的博客上
所以我尝试:
some text
.. image:: http://example.com/image.png
:alt: Alt text
运行“pelican -s pelicanconf.py”之后我有错误:
ERROR: Better Fig. Error: image not found: /Users/kendriu/sources/pelican-blog/contenthttp:/example.com/image.png
ERROR: Could not process ./4_joe.rst
| [Errno 2] No such file or directory: u'/Users/kendriu/sources/pelican-blog/contenthttp:/example.com/image.png'
在我的帖子中没有图像。
问题是:如何将外部图像放入我的博客中。
Pelican希望路径位于内容目录中。 一般来说,这是一个好主意,因为它不适合提取内容和使用其他人的带宽。
您必须使用原始标记执行此操作,如下所示:
.. raw:: html
<img src="http://example.com/image.jpg" alt="alt text">
最好的解决方案是下载映像(假设您有权限),然后将其包含在内容文件夹中,然后自己托管,这是一种默认行为。
要从Google驱动器托管图像,请参阅此讨论: 在网站上显示存储在Google云端硬盘中的文件(例如图像)
Mori的解决方案适合我:
https://drive.google.com/uc?id=FILE-ID
在上面的例子中转换成了这个:
.. raw:: html
<img src="https://drive.google.com/uc?id=0B9o1MNFt5ld1N3k1cm9tVnZxQjg">
使用Google Drive API就像魅力一样。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.