Jekyll 避免在图像标记中重复长路径

Jekyll 避免在图像标记中重复长路径,jekyll,kramdown,Jekyll,Kramdown,我用杰克尔和克拉姆敦建立了一个静态的一面 我经常在图像标记的资产中重复相同的大路径,例如: ![Some image title](/assets/foo/bar/2019-03-17/more/stuff/groundbreaking-plot.svg) 我是否可以将/assets/foo/bar/2019-03-17/more/stuff部分保存在每页变量中,以便在标记中简洁地引用它,如: ![Some image title](??assets_for_this_entry??/grou

我用杰克尔和克拉姆敦建立了一个静态的一面

我经常在图像标记的资产中重复相同的大路径,例如:

![Some image title](/assets/foo/bar/2019-03-17/more/stuff/groundbreaking-plot.svg)
我是否可以将/assets/foo/bar/2019-03-17/more/stuff部分保存在每页变量中,以便在标记中简洁地引用它,如:

![Some image title](??assets_for_this_entry??/groundbreaking-plot.svg)

是的,您可以在中设置。您可以为每个页面设置

---
... other stuff in front matter
myPath: /assets/foo/bar/2019-03-17/more/stuff
---

![]({{ page.myPath }}/image.svg }}}