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

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