跳过正文

Archive

首次發表:

Yore provides a dedicated archive feature to aggregate all posts into a single chronological list.

Setup

Create _index.md in your archive section and set listScope: site in its front matter. The file must be named _index.md. Using index.md prevents Hugo from treating it as a list page.

content/archive/_index.md
---
title: Archive
params:
  listScope: site
---

Excluding pages

pageNoList: true excludes a page from list pages (including the archive) and search results. It does not remove the page from the sitemap.

content/posts/my-post/index.md
---
title: My Post
params:
  pageNoList: true
---

To exclude the page from the sitemap as well, customize Hugo's built-in sitemap template. See the official documentation.

相关源码

反向链接

文章关联