【发布时间】:2019-02-03 10:09:03
【问题描述】:
我在 Drive 中有图像,如何将其添加到 Readme.md 以便在自述文件中显示图像。 我曾尝试使用共享链接,但它不起作用。
【问题讨论】:
-
但是,对于 Google Drive Images,它们似乎都不起作用,因为绝对 URL 不可用。
标签: github google-drive-api github-flavored-markdown
我在 Drive 中有图像,如何将其添加到 Readme.md 以便在自述文件中显示图像。 我曾尝试使用共享链接,但它不起作用。
【问题讨论】:
标签: github google-drive-api github-flavored-markdown
例如,我在 google 驱动器上有 a.jpg。
右击图片,点击Share...
点击Advanced并将Who can access选项更改为Public on the web - Anyone on the Internet
link to share,你会得到类似的东西
https://drive.google.com/file/d/
/view?usp=sharing

示例:我在 google 中有这张 octocat 图像,它的文件 ID 是 1913oZeBZPBNiUuk8gu3ZSbLBA2l_VQtG。您可以在您的降价文件中甚至在此答案中尝试。
希望这会有所帮助。
【讨论】:
image.jpg 上传到您的 Google 云端硬盘get link按钮Anyone with the link
<FILEID>,如图所示(以蓝色突出显示),然后单击 Done。在撰写本文时,可共享链接采用以下形式:https://drive.google.com/file/d/``/view?usp=sharing
<FILEID> 和锚标记在 Markdown 中插入图像,如下所示:<a href="https://drive.google.com/uc?export=view&id=<FILEID>"><img src="https://drive.google.com/uc?export=view&id=<FILEID>" style="width: 650px; max-width: 100%; height: auto" title="Click to enlarge picture" />
请注意,括号“”不得与文件 ID 一起出现。 图片的大小可以在style属性中根据需要通过调整宽度和高度来调整。单击渲染的图像会将其打开为原始大小
【讨论】: