Page methods
Use these methods with a Page object.
Use these methods with a Page object.
PAGE.Aliases ⟼ []stringReturns the URL aliases as defined in front matter. Read More »
PAGE.AllTranslations ⟼ page.PagesReturns all translations of the given page, including the current language. Read More »
PAGE.AlternativeOutputFormats ⟼ page.OutputFormatsReturns a slice of OutputFormat objects, excluding the current output format, each representing one of the output formats enabled for the given page. Read More »
PAGE.Ancestors ⟼ page.PagesReturns a collection of Page objects, one for each ancestor section of the given page. Read More »
PAGE.BundleType ⟼ stringReturns the bundle type of the given page, or an empty string if the page is not a page bundle. Read More »
PAGE.CodeOwners ⟼ []stringReturns of slice of code owners for the given page, derived from the CODEOWNERS file in the root of the project directory. Read More »
PAGE.Content ⟼ template.HTMLReturns the rendered content of the given page. Read More »
PAGE.ContentWithoutSummary ⟼ template.HTMLReturns the rendered content of the given page, excluding the content summary. Read More »
PAGE.CurrentSection ⟼ page.PageReturns the Page object of the section in which the given page resides. Read More »
PAGE.Data ⟼ page.DataReturns a unique data object for each page kind. Read More »
PAGE.Date ⟼ time.TimeReturns the date of the given page. Read More »
PAGE.Description ⟼ stringReturns the description of the given page as defined in front matter. Read More »
PAGE.Draft ⟼ boolReports whether the given page is a draft as defined in front matter. Read More »
PAGE1.Eq PAGE2 ⟼ boolReports whether two Page objects are equal. Read More »
PAGE.ExpiryDate ⟼ time.TimeReturns the expiry date of the given page. Read More »
PAGE.File ⟼ hugolib.fileInfoFor pages backed by a file, returns file information for the given page. Read More »
PAGE.FirstSection ⟼ page.PageReturns the Page object of the top level section of which the given page is a descendant. Read More »
PAGE.Fragments ⟼ tableofcontents.FragmentsReturns a data structure of the fragments in the given page. Read More »
PAGE.FuzzyWordCount ⟼ intReturns the number of words in the content of the given page, rounded up to the nearest multiple of 100. Read More »
PAGE.GetPage PATH ⟼ page.PageReturns a Page object from the given path. Read More »
PAGE.GetTerms TAXONOMY ⟼ page.PagesReturns 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. Read More »
PAGE.GitInfo ⟼ source.GitInfoReturns Git information related to the last commit of the given page. Read More »
PAGE.HasMenuCurrent MENU MENUENTRY ⟼ boolReports whether the given Page object matches the Page object associated with one of the child menu entries under the given menu entry in the given menu. Read More »
PAGE.HasShortcode NAME ⟼ boolReports whether the given shortcode is called by the given page. Read More »
PAGE.HeadingsFiltered ⟼ tableofcontents.HeadingsReturns a slice of headings for each page related to the given page. Read More »
PAGE.InSection SECTION ⟼ boolReports whether the given page is in the given section. Read More »
PAGE1.IsAncestor PAGE2 ⟼ boolReports whether PAGE1 is an ancestor of PAGE2. Read More »
PAGE1.IsDescendant PAGE2 ⟼ boolReports whether PAGE1 is a descendant of PAGE2. Read More »
PAGE.IsHome ⟼ boolReports whether the given page is the home page. Read More »
PAGE.IsMenuCurrent MENU MENUENTRY ⟼ boolReports whether the given Page object matches the Page object associated with the given menu entry in the given menu. Read More »
PAGE.IsNode ⟼ boolReports whether the given page is a node. Read More »
PAGE.IsPage ⟼ boolReports whether the given page is a regular page. Read More »
PAGE.IsSection ⟼ boolReports whether the given page is a section page. Read More »
PAGE.IsTranslated ⟼ boolReports whether the given page has one or more translations. Read More »
PAGE.Keywords ⟼ []stringReturns a slice of keywords as defined in front matter. Read More »
PAGE.Kind ⟼ stringReturns the kind of the given page. Read More »
PAGE.Language ⟼ langs.LanguageReturns the language object for the given page. Read More »
PAGE.Lastmod ⟼ time.TimeReturns the last modification date of the given page. Read More »
PAGE.Layout ⟼ stringReturns the layout for the given page as defined in front matter. Read More »
PAGE.Len ⟼ intReturns the length, in bytes, of the rendered content of the given page. Read More »
PAGE.LinkTitle ⟼ stringReturns the link title of the given page. Read More »
PAGE.Next ⟼ page.PageReturns the next page in a site’s collection of regular pages, relative to the current page. Read More »
PAGE.NextInSection ⟼ page.PageReturns the next regular page in a section, relative to the given page. Read More »
PAGE.OutputFormats ⟼ []OutputFormatReturns a slice of OutputFormat objects, each representing one of the output formats enabled for the given page. Read More »
PAGE.Page ⟼ page.PageReturns the Page object of the given page. Read More »
PAGE.Pages ⟼ page.PagesReturns a collection of regular pages within the current section, and section pages of immediate descendant sections. Read More »
PAGE.Paginate COLLECTION [N] ⟼ page.PagerPaginates a collection of pages. Read More »
PAGE.Paginator ⟼ page.PagerPaginates the collection of regular pages received in context. Read More »
PAGE.Param KEY ⟼ anyReturns a page parameter with the given key, falling back to a site parameter if present. Read More »
PAGE.Params ⟼ maps.ParamsReturns a map of custom parameters as defined in the front matter of the given page. Read More »
PAGE.Parent ⟼ page.PageReturns the Page object of the parent section of the given page. Read More »
PAGE.Path ⟼ stringReturns the logical path of the given page. Read More »
PAGE.Permalink ⟼ stringReturns the permalink of the given page. Read More »
PAGE.Plain ⟼ stringReturns the rendered content of the given page, removing all HTML tags. Read More »
PAGE.PlainWords ⟼ []stringCalls the Plain method, splits the result into a slice of words, and returns the slice. Read More »
PAGE.Prev ⟼ page.PageReturns the previous page in a site’s collection of regular pages, relative to the current page. Read More »
PAGE.PrevInSection ⟼ page.PageReturns the previous regular page in a section, relative to the given page. Read More »
PAGE.PublishDate ⟼ time.TimeReturns the publish date of the given page. Read More »
PAGE.RawContent ⟼ stringReturns the raw content of the given page. Read More »
PAGE.ReadingTime ⟼ intReturns the estimated reading time, in minutes, for the given page. Read More »
PAGE.Ref OPTIONS ⟼ stringReturns the absolute URL of the page with the given path, language, and output format. Read More »
PAGE.RegularPages ⟼ page.PagesReturns a collection of regular pages within the current section. Read More »
PAGE.RegularPagesRecursive ⟼ page.PagesReturns a collection of regular pages within the current section, and regular pages within all descendant sections. Read More »
PAGE.RelPermalink ⟼ stringReturns the relative permalink of the given page. Read More »
PAGE.RelRef OPTIONS ⟼ stringReturns the relative URL of the page with the given path, language, and output format. Read More »
PAGE.Render NAME ⟼ template.HTMLRenders the given template with the given page as context. Read More »
PAGE.RenderShortcodes ⟼ template.HTMLRenders all shortcodes in the content of the given page, preserving the surrounding markup. Read More »
PAGE.RenderString [OPTIONS] MARKUP ⟼ template.HTMLRenders markup to HTML. Read More »
PAGE.Resources ⟼ resource.ResourcesReturns a collection of page resources. Read More »
PAGE.Scratch ⟼ maps.ScratchReturns a “scratch pad” on the given page to store and manipulate data. Read More »
PAGE.Section ⟼ stringReturns the name of the top level section in which the given page resides. Read More »
PAGE.Sections ⟼ page.PagesReturns a collection of section pages, one for each immediate descendant section of the given page. Read More »
PAGE.Site ⟼ page.siteWrapperReturns the Site object. Read More »
PAGE.Sitemap ⟼ config.SitemapConfigReturns the sitemap settings for the given page as defined in front matter, falling back to the sitemap settings as defined in the site configuration. Read More »
PAGE.Sites ⟼ page.SitesReturns a collection of all Site objects, one for each language, ordered by language weight. Read More »
PAGE.Slug ⟼ stringReturns the URL slug of the given page as defined in front matter. Read More »
PAGE.Store ⟼ maps.ScratchReturns a persistent “scratch pad” on the given page to store and manipulate data. Read More »
PAGE.Summary ⟼ template.HTMLReturns the summary of the given page. Read More »
PAGE.TableOfContents ⟼ template.HTMLReturns a table of contents for the given page. Read More »
PAGE.Title ⟼ stringReturns the title of the given page. Read More »
PAGE.TranslationKey ⟼ stringReturns the translation key of the given page. Read More »
PAGE.Translations ⟼ page.PagesReturns all translations of the given page, excluding the current language. Read More »
PAGE.Truncated ⟼ boolReports whether the content length exceeds the summary length. Read More »
PAGE.Type ⟼ stringReturns the content type of the given page. Read More »
PAGE.Weight ⟼ intReturns the weight of the given page as defined in front matter. Read More »
PAGE.WordCount ⟼ intReturns the number of words in the content of the given page. Read More »