我尝试了几种方法,但到目前为止都没有效果。我想在我的主博客页面上添加用 R markdown (.Rmd) 编写的博客文章的图像预览,其中通常会显示许多帖子和项目。我可以使用以下从 Hugo 获取的代码使其在普通 markdown (.md) 中工作academic-theme
here https://raw.githubusercontent.com/gcushen/hugo-academic/master/exampleSite/content/project/deep-learning.md
+++
# Optional image to display on homepage (relative to `static/img/` folder).
image_preview = "bubbles.jpg"
+++
结果如图所示here https://themes.gohugo.io/theme/academic/(参见部分Projects
).
但是,我不知道如何将其翻译为.Rmd
yaml
在我的博客文章中。我可以使用下面的方法在顶部包含图像,但因为我使用的是toc
目录选项,图像仅在toc
因此不会出现在主页上的帖子预览中。
---
title: some title
author: some author
date: 'some date'
slug: some-slug
categories:
- some category
tags:
- some-tag
output:
blogdown::html_page:
toc: true
number_sections: true
toc_depth: 2
---
![](/post/img/some_img.png)
理想情况下,图像仅显示在主页上的预览中,而不显示在实际的博客文章中(目的是用视觉上吸引人的图像“吸引”读者到实际内容),但如果不可能,否则我也可以,如果只要图像显示在主页的预览中,它就会显示在实际帖子的顶部。
If the image_preview
参数与md
文档,它也应该与 Rmd 一起使用,前提是您使用以下语法:
我猜:
---
title: some title
author: some author
date: 'some date'
slug: some-slug
categories:
- some category
tags:
- some-tag
output:
blogdown::html_page:
toc: true
number_sections: true
toc_depth: 2
image_preview: 'bubbles.jpg'
---
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)