快轉到主要內容

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 此標題的連結

反向連結

文章關聯

無障礙設定