避免在图片标签中重复长路径
Avoiding repeating long paths in image tags
我正在使用 Jekll 和 kramdown 构建静态端。
我经常在图片标签的资产中重复相同的大路径,例如:

我能否以某种方式将 /assets/foo/bar/2019-03-17/more/stuff
部分保存在每页变量中,以便我可以在降价中简洁地引用它,例如:

是的,您可以在每个页面的 front matter. You can set custom variables 中设置它。
---
... other stuff in front matter
myPath: /assets/foo/bar/2019-03-17/more/stuff
---

我能否以某种方式将 /assets/foo/bar/2019-03-17/more/stuff
部分保存在每页变量中,以便我可以在降价中简洁地引用它,例如:

是的,您可以在每个页面的 front matter. You can set custom variables 中设置它。
---
... other stuff in front matter
myPath: /assets/foo/bar/2019-03-17/more/stuff
---
![]({{ page.myPath }}/image.svg }}}