快轉到主要內容

Docs

查看原始碼編輯此頁 (外部連結)
首次發表:

Templates (外部連結) JS and CSS assets (外部連結)

All configurations on docs content type. The blog and docs content types share most of their page and section fields, so the documented below are separate into unique fields and common fields. These are theme parameters so the fields should goes under params key.

Page configuration 此標題的連結

Unique fields 此標題的連結

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

NameTypeDescription
docsNavCollapsedbooleanCollapse this section by default in the sidebar navigation. Only applies to section pages.
docsAutoCollapseCategoriesbooleanAuto collapse other sections when expanding one. Cannot be overridden in the front matter.
docsSidebarHidablebooleanShow a button that hides the sidebar on desktop. Cannot be overridden in the front matter.
docsIconstringIcon shown next to this page or section in the sidebar navigation.
docsNavClassstringAdditional CSS class applied to the sidebar nav.
註記

Previous/next links on docs pages only traverse other pages within the same docs section, unlike blog's previous/next links, which span the entire site.

Common fields 此標題的連結

NameTypeDescription
linkbooleanURL link to any internal or external page.
breadcrumbbooleanShow breadcrumb navigation above the page title.
pageHeroStylestringRender a hero section above the page. Set to disable to turn it off for a specific page.
pageTOCStylestringWhere the table of contents is rendered. Accepts top, sidebar, or disable. On docs pages, top is treated the same as sidebar.
pageKgStylestringWhere the knowledge graph widget is rendered. See Knowledge Graph for what this widget does.
pageShowActionsbooleanShow action buttons (e.g. share, copy link) next to the page title.
pageShowMetabooleanShow publish date, last-updated date, and author info below the title.
pageShowAuthorsbooleanShow author information. Only takes effect when pageShowMeta is enabled.
pageShowCategoriesbooleanShow the page's categories below the content.
pageShowTagsbooleanShow the page's tags below the content.
pageShowNextbooleanShow previous/next page links at the bottom of the page.
pageShowBacklinksbooleanShow a list of pages that link back to this one.
staleContentWarningbooleanShow a warning when an article has not been updated in staleDays.
staleDaysintNumber of days before an article is considered stale.
pageNoListbooleanExclude this page from search indexing and from list views.

Section configuration 此標題的連結

Unique fields 此標題的連結

NameTypeDescription
docsNavSortstringSort order for child pages in the sidebar navigation. Accepts Date, ExpiryDate, Lastmod, Length, LinkTitle, PublishDate, Title, Weight, or a page parameter prefixed with Param.. Defaults to Hugo's default page order if unset or invalid.

Common fields 此標題的連結

NameTypeDescription
breadcrumbbooleanShow breadcrumb navigation above the page title.
listScopestringWhich pages to list. Set to site to list every regular page on the site, or leave unset to list only pages within the current section.
sectionGroupBystringGroup listed pages under headings. Accepts Date, ExpiryDate, Lastmod, PublishDate, or a page parameter prefixed with Param. (e.g. Param.category). Leave unset to disable grouping.
sectionGroupLayoutstringDate format used for group headings when sectionGroupBy is a date field. See layout strings (外部連結).
sectionGroupOrderstringOrder of groups. Accepts asc or desc.
sectionSortBystringSort key for listed pages within each group. Accepts Date, ExpiryDate, Lastmod, Length, LinkTitle, PublishDate, Title, Weight, or a page parameter prefixed with Param..
sectionSortOrderstringSort order. Accepts asc or desc.

反向連結

文章關聯

無障礙設定