GoCalf Calf 的自留地 · 昙花一现
由 AI 生成

Organize content

Use Hugo’s native content tree. Directories are storage; branch and leaf bundles express actual documents. Sidera adds browsing policies without a parallel page-ID or collection registry.

text
content/
  _index.md                 # optional home introduction
  about.md                  # standalone page
  journal/
    _index.md               # collection root, optionally preset: blog
    first-post/
      index.md              # article leaf bundle
      photo.jpg             # public resource
  handbook/
    _index.md               # optionally preset: docs
    basics/
      _index.md             # body-bearing parent
      install.md            # child document

index.md is a leaf: adjacent Markdown may be content resources, not independent child pages. _index.md is a branch and can have a body plus children. For an ordered document tree, author every intended intermediate branch explicitly. Native title, description, date, lastmod, draft, type, URL and taxonomy assignments stay at top level; theme presentation belongs under params.

Browsing scope is independent

Top-level sections automatically form browsing roots. A nested section normally shares its nearest root. Give a nested _index.md local params.scope_root: true only when it needs independent search/navigation/lists. Do not cascade this marker. An outer collection excludes the independent root’s articles from its own lists. A scope boundary does not block actual native cascade inheritance.

Collections may share a preset but have separate names and logos:

yaml
---
title: Notes on observing the night sky
description: Measurements, reading and experiments.
preset: notes
params:
  name: Sky notes
  logo: images/observatory.svg
---

name is a concise context label, not a route or ID. title stays the full heading and card/search title. description supplies summary copy. Logo/name are local root fields, not site defaults or descendant metadata. Missing logo means a text-only card; collection cards show latest owned article activity rather than root edit time.

Choose the right organizing tool

For generic engine concepts see Hugo’s content organization and page bundles.

Dates and maintenance

For maintained documentation, keep explicit native timestamps:

yaml
date: 2026-01-01T09:00:00+08:00
lastmod: 2026-01-03T14:30:00+08:00

Keep date as the original creation date; update lastmod when the page receives a meaningful content or configuration change. Include a timezone offset. Do not bump every page on each build, deploy or unrelated edit. These are page-local fields, not dates to cascade over a whole collection. The docs preset emphasizes updates and uses these timestamps for its recent-document lists; missing dates are not invented by the theme. A consuming site still owns its native date-resolution policy.

子文档

  • Presets and inheritance

    Set native preset: blog, notes or docs on a section, or configure its capabilities directly. Presets never create browsing roots, change native content type or assign membership to every article. One distinct preset per section is …

  • Taxonomies, authors and series

    Use native top-level assignments across all content kinds: yaml 复制 --- title: Observing a useful pattern authors: [editor, researcher] tags: [science/optics, tools] categories: [learning] series: field-notes --- The theme’s narrow taxonomy …

  • Ordered document trees

    Use _index.md for body-bearing parents and index.md or topic.md for leaves. The docs preset selects children mode and a full page tree, but those capabilities are available to any section without a preset. yaml 复制 --- title: Handbook …