Pages

The Page type represents a document within your content folder.

Properties

NameDescription
absolutePathAbsolute path of the page on disk (not portable).
basenameBasename of the page, including language and extension. Example: my-page.fr.md.
basenameWithoutLangBasename of the page, excluding language and extension. Example: my-page.
createdAtCreation date (Moment.js object).
descriptionPage description.
dirPage relative directory.
draftDraft status. true is page is a draft. Shortcut to metadata.draft
headingsArray of headings, shortcut to metadata.headings.
htmlPathFor a markdown file, this is where the corresponding html file will be written.
indexableReturns true if a page is indexable. Based on the metadata flag noindex.
keywordsPage keywords (Array), shortcut to metadata.keywords.
languagePage language (ISO 2 letters) taken from either metadata.language or file extension
destPathFor a markdown file, this property equals .htmlPath otherwise, this is the destination file path that will be written.
markdownPage markdown contents, without the front-matter block.
metadataPage metadata (Object) parsed from front-matter block.
pathRelative path to the file. Example: my-section/mypage.fr.md.
pathWithoutLangRelative path of the page without lang or extension. Example: my-section/mypage.
searchableTextSearchable page content. Primarily used by the integrated search engine. Generated from the html contents stripped from tags.
sectionPage section (instance of Section)
slugPage slug. Will return the metadata.slug if it exists, or basenameWithoutLang.
tagsPage tags (Array), shortcut to metadata.tags.
titlePage title.
translationsPage translations. (Page[])
typePage type, taken from its metadaata or the parent section. If none is specified, "default" is returned.
updatedAtLast update date (Moment.js object).
urlPage url.
weightPage weight, used for ordering in lists.

Methods

NameDescription
getNextPage(sameSection = true): PageGet the next page in section, or in the next section if sameSectionequals false.
getPreviousPage(sameSection = true): PageGet the previous page in section, or in the previous section if sameSectionequals false.
hasTranslationInto(lang: String): BooleanCheck if a translation into language lang exists.
isDefaultLanguage(): BooleanCheck if the page is written in the default language specified in config (default: "en").
isIndex(): BooleanCheck if the page is an index page (index.md, index.fr.md, etc).
isTranslationOf(otherPage: Page): BooleanCheck if the page is a translation of another.

Edit this page / submit change