【发布时间】:2021-12-25 17:40:43
【问题描述】:
我意识到它应该是这样的:{filename}path/to/file 或{attach}path/to/file 但是如何在模板<img src="?"/> 中指定路径以便正确呈现?
【问题讨论】:
标签: python-3.x pelican static-site-generation
我意识到它应该是这样的:{filename}path/to/file 或{attach}path/to/file 但是如何在模板<img src="?"/> 中指定路径以便正确呈现?
【问题讨论】:
标签: python-3.x pelican static-site-generation
你要找的是{static}path/to/file。
此外,您不必在模板中指定 img 标记。
Pelican(或者更确切地说是 docutils)负责处理它。
编辑:
关于布局,我倾向于使用:
.. image:: {static}/path/to/image.jpg
:width: 100%
【讨论】:
{static} 处理文章中的图像。另见docs.getpelican.com/en/latest/…。