我尝试了几种方法,但到目前为止都没有。我想在我的主博客页面上包含用 R markdown (.Rmd) 编写的博客文章的图像预览,其中通常显示许多文章和项目。我可以使用从 Hugo here获取的以下代码使其在普通降价(.md)中工作academic-theme
+++
# Optional image to display on homepage (relative to `static/img/` folder).
image_preview = "bubbles.jpg"
+++
结果将如下所示(参见第 1 节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
---

理想情况下,图像仅显示在主页的预览中,而不是实际的博客文章中(目的是用视觉上吸引人的图像“吸引”读者到实际内容)但如果不可能,否则我也很好,如果只要它显示在主页的预览中,图像就会显示在实际帖子的顶部。