跳过正文

Content Type

查看源码 编辑此页 (外部链接)
首次發表:

Yore provides three content types: blog, docs, and gallery. Each type renders pages with a different set of templates and supports a different set of configuration fields. This guide shows you how to assign a type to your pages.

Setup 此标题的链接

There are two ways to assign a content type to a page.

Directory-based 此标题的链接

Place your Markdown files under the matching content directory. Hugo automatically assigns the type based on the directory name:

content/docs/     → type: docs
content/gallery/  → type: gallery

The default type blog is assigned if the path doesn't match any of them.

Cascade 此标题的链接

Use cascade when your content structure does not map directly to the matching directory. Set it in hugo.yaml to target arbitrary path patterns, or in a section's _index.md to scope it to that section only.

hugo.yaml
cascade:
  - type: docs
    target:
      path: '{/shortcodes,/shortcodes/**}'
content/shortcodes/_index.md
---
title: Shortcode Section
cascade:
  type: docs
---

The hugo.yaml setup is more flexible and centralized than front matter setup.

What's next 此标题的链接

反向链接

文章关联

无障碍设定

字体大小