Loading...

Loading...

Global Variables

VariableDescriptionType
siteSitewide information.object; see Site Variables
pagePage specific information and custom variables set in front-matter.object; see Page Variables
configSite configuration.object (your site’s _config file)
themeTheme configuration. Inherits from site configuration.object (your theme’s _config file)
pathPath of current pagestring
urlFull URL of current pagestring
envEnvironment variables???

warn

Lodash has been removed from global variables since Hexo 5.0.0. You-Dont-Need-Lodash-Underscore might be helpful for your migration.

Site Variables

VariableDescriptionType
site.postsAll postsQuery object
site.pagesAll pagesQuery object
site.categoriesAll categoriesQuery object
site.tagsAll tagsQuery object

Page Variables

Article (page)

VariableDescriptionType
page.titleArticle titlestring
page.dateArticle created dateMoment.js object
page.updatedArticle last updated dateMoment.js object
page.commentsComment enabled or notboolean
page.layoutLayout namestring
page.contentThe full processed content of the articlestring
page.excerptArticle excerptstring
page.moreContents except article excerptstring
page.sourceThe path of the source filestring
page.full_sourceFull path of the source filestring
page.pathThe URL of the article without root URL. We usually use url_for(page.path) in theme.string
page.permalinkFull (encoded) URL of the articlestring
page.prevThe previous post, null if the post is the first post???
page.nextThe next post, null if the post is the last post???
page.rawThe raw data of the article???
page.photosThe photos of the article (Used in gallery posts)array of ???
page.linkThe external link of the article (Used in link posts)string

Post (post): Same as page layout but add the following variables.

VariableDescriptionType
page.publishedTrue if the post is not a draftboolean
page.categoriesAll categories of the postarray of ???
page.tagsAll tags of the postarray of ???

Home (index)

VariableDescriptionType
page.per_pagePosts displayed per pagenumber
page.totalTotal number of pagesnumber
page.currentCurrent page numbernumber
page.current_urlThe URL of current pagestring
page.postsPosts in this page (Data Model)object
page.prevPrevious page number. 0 if the current page is the first.number
page.prev_linkThe URL of previous page. '' if the current page is the first.string
page.nextNext page number. 0 if the current page is the last.number
page.next_linkThe URL of next page. '' if the current page is the last.string
page.pathThe URL of current page without root URL. We usually use url_for(page.path) in theme.string

Archive (archive): Same as index layout but add the following variables.

VariableDescriptionType
page.archiveEquals trueboolean
page.yearArchive year (4-digit)number
page.monthArchive month (2-digit without leading zeros)number

Category (category): Same as index layout but add the following variables.

VariableDescriptionType
page.categoryCategory namestring

Tag (tag): Same as index layout but add the following variables.

VariableDescriptionType
page.tagTag namestring
Comments
Data Loading...