HUGO
Menu
GitHub 87548 stars Mastodon

Aliases

PAGE.Aliases

返回 front matter 中定义的别名作为服务器相对 URL,根据当前内容维度解析。

AllTranslations

PAGE.AllTranslations

返回给定页面的所有翻译,包括当前语言,按语言权重排序。

AlternativeOutputFormats

PAGE.AlternativeOutputFormats

返回 OutputFormat 对象的切片,不包括当前输出格式,每个代表为给定页面启用的一个输出格式。

Ancestors

PAGE.Ancestors

返回 Page 对象的集合,每个代表给定页面的一个祖先栏目。

BundleType

PAGE.BundleType

返回给定页面的捆绑包类型,如果页面不是页面捆绑包则返回空字符串。

CodeOwners

PAGE.CodeOwners

返回给定页面的代码所有者切片,从项目目录根目录中的 CODEOWNERS 文件派生。

Content

PAGE.Content

返回给定页面的渲染内容。

ContentWithoutSummary

PAGE.ContentWithoutSummary

返回给定页面的渲染内容,不包括内容摘要。

CurrentSection

PAGE.CurrentSection

返回给定页面所在栏目的 Page 对象。

Data

PAGE.Data

为每种页面类型返回唯一的数据对象。

Date

PAGE.Date

返回给定页面的日期。

Description

PAGE.Description

返回 front matter 中定义的给定页面的描述。

Draft

PAGE.Draft

报告给定页面是否为 front matter 中定义的草稿。

Eq

PAGE1.Eq PAGE2

报告两个 Page 对象是否相等。

ExpiryDate

PAGE.ExpiryDate

返回给定页面的过期日期。

File

PAGE.File

对于有文件支持的页面,返回给定页面的文件信息。

FirstSection

PAGE.FirstSection

返回给定页面为其后代的顶层栏目的 Page 对象。

Fragments

PAGE.Fragments

返回给定页面中片段的数据结构。

FuzzyWordCount

PAGE.FuzzyWordCount

Returns the number of words in the content of the given page, rounded up to the nearest multiple of 100.

GetPage

PAGE.GetPage PATH

Returns a Page object from the given path.

GetTerms

PAGE.GetTerms TAXONOMY

Returns a collection of term pages for terms defined on the given page in the given taxonomy, ordered according to the sequence in which they appear in front matter.

GitInfo

PAGE.GitInfo

返回与给定页面最后一次提交相关的 Git 信息。

HasMenuCurrent

PAGE.HasMenuCurrent MENU MENUENTRY

报告给定 Page 对象是否与给定菜单中给定菜单条目下的子菜单条目关联的 Page 对象匹配。

HasShortcode

PAGE.HasShortcode NAME

Reports whether the given shortcode is called by the given page.

HeadingsFiltered

PAGE.HeadingsFiltered

Returns a slice of headings for each page related to the given page.

InSection

PAGE.InSection SECTION

Reports whether the given page is in the given section.

IsAncestor

PAGE1.IsAncestor PAGE2

报告 PAGE1 是否是 PAGE2 的祖先。

IsDescendant

PAGE1.IsDescendant PAGE2

报告 PAGE1 是否是 PAGE2 的后代。

IsHome

PAGE.IsHome

报告给定页面是否是主页。

IsMenuCurrent

PAGE.IsMenuCurrent MENU MENUENTRY

报告给定 Page 对象是否与给定菜单中给定菜单条目关联的 Page 对象匹配。

IsNode

PAGE.IsNode

报告给定页面是否是节点页面。

IsPage

PAGE.IsPage

报告给定页面是否是常规页面。

IsSection

PAGE.IsSection

报告给定页面是否是栏目页面。

IsTranslated

PAGE.IsTranslated

Reports whether the given page has one or more translations.

Keywords

PAGE.Keywords

返回 front matter 中定义的关键词切片。

Kind

PAGE.Kind

Returns the kind of the given page.

Language

PAGE.Language

Returns the language object for the given page.

Lastmod

PAGE.Lastmod

返回给定页面的最后修改日期。

Layout

PAGE.Layout

返回 front matter 中定义的给定页面的布局。

Len

PAGE.Len

返回给定页面的渲染内容的长度(以字节为单位)。

LinkTitle

PAGE.LinkTitle

返回给定页面的链接标题。

Next

PAGE.Next

返回站点常规页面集合中相对于当前页面的下一个页面。

NextInSection

PAGE.NextInSection

返回当前栏目中相对于给定页面的下一个常规页面。

OutputFormats

PAGE.OutputFormats

返回 OutputFormat 对象的切片,每个代表为给定页面启用的输出格式之一。

Page

PAGE.Page

返回给定页面的 Page 对象。

Pages

PAGE.Pages

返回当前栏目内的常规页面集合,以及直接后代栏目的栏目页面。

Paginate

PAGE.Paginate COLLECTION [N]

分页页面集合。

Paginator

PAGE.Paginator

分页上下文中接收的常规页面集合。

Param

PAGE.Param KEY

返回具有给定键的页面参数,如果存在则回退到站点参数。

Params

PAGE.Params

返回给定页面 front matter 中定义的自定义参数映射。

Parent

PAGE.Parent

返回给定页面的父栏目的 Page 对象。

Path

PAGE.Path

返回给定页面的逻辑路径。

Permalink

PAGE.Permalink

返回给定页面的永久链接。

Plain

PAGE.Plain

返回给定页面的渲染内容,移除所有 HTML 标签。

PlainWords

PAGE.PlainWords

调用 Plain 方法,将结果分割成单词切片,并返回该切片。

Prev

PAGE.Prev

返回站点常规页面集合中相对于当前页面的上一个页面。

PrevInSection

PAGE.PrevInSection

返回当前栏目中相对于给定页面的上一个常规页面。

PublishDate

PAGE.PublishDate

返回给定页面的发布日期。

RawContent

PAGE.RawContent

返回给定页面的原始内容。

ReadingTime

PAGE.ReadingTime

返回给定页面的估计阅读时间(以分钟为单位)。

Ref

PAGE.Ref OPTIONS

返回具有给定路径、语言和输出格式的页面的绝对 URL。

RegularPages

PAGE.RegularPages

返回当前栏目内的常规页面集合。

RegularPagesRecursive

PAGE.RegularPagesRecursive

Returns a collection of regular pages within the current section, and regular pages within all descendant sections.

RelPermalink

PAGE.RelPermalink

返回给定页面的相对永久链接。

RelRef

PAGE.RelRef OPTIONS

返回具有给定路径、语言和输出格式的页面的相对 URL。

Render

PAGE.Render NAME

Renders the given template with the given page as context.

RenderShortcodes

PAGE.RenderShortcodes

渲染给定页面内容中的所有短代码,保留周围的标记。

RenderString

PAGE.RenderString [OPTIONS] MARKUP

Renders markup to HTML.

Resources

PAGE.Resources

返回页面资源的集合。

Rotate

PAGE.Rotate DIMENSION

Returns a collection of all pages sharing the same identity across the specified dimension, including the current page, sorted by the dimension's weight.

Scratch

PAGE.Scratch

Returns a "scratch pad" to store and manipulate data, scoped to the current page.

Section

PAGE.Section

返回给定页面所在的顶级栏目的名称。

Sections

PAGE.Sections

Returns a collection of section pages, one for each immediate descendant section of the given page.

Site

PAGE.Site

返回 Site 对象。

Sitemap

PAGE.Sitemap

Returns the sitemap settings for the given page as defined in front matter, falling back to the sitemap settings as defined in the site configuration.

Sites

PAGE.Sites

Returns a collection of all Site objects, one for each language, ordered by language weight.

Slug

PAGE.Slug

返回给定页面在 front matter 中定义的 URL slug。

Store

PAGE.Store

Returns a "scratch pad" to store and manipulate data, scoped to the current page.

Summary

PAGE.Summary

返回给定页面的摘要。

TableOfContents

PAGE.TableOfContents

返回给定页面的目录。

Title

PAGE.Title

返回给定页面的标题。

TranslationKey

PAGE.TranslationKey

返回给定页面的翻译键。

Translations

PAGE.Translations

Returns all translations of the given page, excluding the current language, sorted by language weight.

Truncated

PAGE.Truncated

报告内容长度是否超过摘要长度。

Type

PAGE.Type

返回给定页面的内容类型。

Weight

PAGE.Weight

返回给定页面在 front matter 中定义的权重。

WordCount

PAGE.WordCount

Returns the number of words in the content of the given page.