How to add feature or thumbnail image for post in .Rmd file

五迷三道 提交于 2019-12-22 14:39:15

问题


I'm currently trying to setup a hugo blog with blogdown and can't find a way to add feature or thumbnail images to posts from within .Rmd files, which would like this with the tranquilpeak theme:

As far as I understand, it is easy to do in .md files by just adding some syntax like this:

+++
featuredImage = "img/foobar.jpg"
+++

I found this in the minos theme and in a discourse post. But how can I do this inside a .Rmd file?


回答1:


It does not matter whether you use .md or .Rmd: if the theme supports the featuredImage option, you can also use it in .Rmd. The only thing you need to make sure is to write metadata in YAML instead of TOML if the post format is .Rmd (see documentation), i.e.,

---
featuredImage: "img/foobar.jpg"
---


来源:https://stackoverflow.com/questions/46164301/how-to-add-feature-or-thumbnail-image-for-post-in-rmd-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!