跳过正文

Gallery

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

The gallery content type is designed to be minimal. Pages render without a sidebar, table of contents, or related content by default. These are theme parameters so the fields should goes under params key.

Page configuration 此标题的链接

Accepted fields for individual pages of type gallery. All settings can be overridden in the front matter, unless explicitly noted as unsupported.

NameTypeDescription
linkbooleanURL link to any internal or external page.
breadcrumbbooleanShow breadcrumb navigation above the page title. Not shown unless explicitly enabled.
galleryPageLeadstringA short lead paragraph shown below the title.
pageShowMetabooleanShow the publish date below the title.
pageNoListbooleanExclude this page from search indexing and from list views.

Section configuration 此标题的链接

Gallery sections share the same grouping and sorting fields as blog and docs sections. See shared configuration for listScope, sectionGroupBy, sectionGroupLayout, sectionGroupOrder, sectionSortBy, and sectionSortOrder.

Advanced Usage 此标题的链接

The blog section's layout doesn't support cover images. To add cover image support, set its type to gallery to use the gallery's section layout instead.

hugo.yaml
cascade:
  - type: gallery
    target:
      path: '{/blog,/blog/**}'
      kind: section

You might also want to give your blog cover a different look, which you can specify using a CSS selector:

main:has(.gallery-page-item[href*='/blog/']) /* ... */ {
  /* ... */
}

反向链接

文章关联

无障碍设定

字体大小