Banner 位文章
约
1
分钟阅读
(
218
个字
,
1
张图片
)
阅读
切换到原始 Markdown 内容
在站点首页顶部位置可以配置 1 大 3 小 共计 4 篇 Banner 位置的文章。
效果如下图:
在 _config.linen.yml 中加入如下格式的内容即可:
_config.linen.yml1 2 3
| topArticles: - _posts/quick-start.md - _posts/lorem.md
|
重新启动 Hexo 预览变更内容。
值得一提的是,这里的 topArticles 可以配置超过 4 条数据,但是只会渲染前 4 条有效文章。
有效文章指的是,如果我配置了一篇不存在的文章,那么该条记录将被过滤掉。
_config.linen.yml1 2 3 4 5
| topArticles: - _posts/fake-1.md - _posts/fake-2.md - _posts/quick-start.md - _posts/lorem.md
|
比如这个例子,fake-1 和 fake-2 其实并不存在,它不影响 quick-start 作为第一篇有效文章。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| --- title: Banner 位文章 date: 2026-03-28 23:57 cover: /img/vackground-com-hDQ-dUjQN8E-unsplash.jpg coverInfo: author: vackground.com url: https://unsplash.com/photos/a-blue-and-white-abstract-background-with-hexagonal-shapes-hDQ-dUjQN8E series: 用户指南 appendRawMarkdown: true tocType: flat translations: ['en'] ---
在站点首页顶部位置可以配置 1 大 3 小 共计 4 篇 Banner 位置的文章。
效果如下图:

在 `_config.linen.yml` 中加入如下格式的内容即可:
```yaml _config.linen.yml topArticles: - _posts/quick-start.md - _posts/lorem.md ```
重新启动 Hexo 预览变更内容。
值得一提的是,这里的 topArticles 可以配置超过 4 条数据,但是只会渲染前 4 条**有效文章**。
有效文章指的是,如果我配置了一篇不存在的文章,那么该条记录将被过滤掉。
```yaml _config.linen.yml topArticles: - _posts/fake-1.md - _posts/fake-2.md - _posts/quick-start.md - _posts/lorem.md ```
比如这个例子,fake-1 和 fake-2 其实并不存在,它不影响 quick-start 作为第一篇有效文章。
|