Skip to content

Objects

ReFreezed edited this page Jun 30, 2018 · 14 revisions

site

These values can be configured in config.lua.

site.baseUrl

The base part of the website's URL, e.g. http://www.example.com/.

site.defaultLayout

The default layout pages will use. The default value is "page" (which corresponds to the file layouts/page.html).

site.languageCode

The code for the language of the website, e.g. dk. (This doesn't do much yet, but will be used for i18n in the future.)

site.title

The title of the website.

page

page.aliases

A list of slugs that point to previous locations of the current page. Example:

{{
page.title   = "New Improved Page"
page.aliases = {"/my-page/", "/some-archived-page/"}
}}

Note: Queries are not yet supported in aliases.

page.content

The contents of the current page. Available in layouts.

page.isDraft

If the current page is a draft. Drafts are excluded from the building process (unless the --drafts option is used).

page.isHome

If the current page is the root index page, aka the home page.

page.isIndex

If the current page is an index page.

page.isPage

If the current page is in fact a page. This value is false for CSS files.

page.isSpecial

If the current page is some kind of special page. Special pages are ignored by subpages(). Set this to true for e.g. 404 error pages.

page.layout

What layout the page should use. The default is the value of site.defaultLayout.

page.params

Table for storing any custom data you want.

page.permalink

The permanent URL to the current page.

page.publishDate

What date the page is published (in local time). If the date is in the future then the page is excluded from the build process. Must have the format "YYYY-MM-DD hh:mm:ss".

page.title

The title of the current page. Each page should update this value.

page.url

The relative URL to the current page on the site.

Other Objects

data

Access data from the data folder. Type e.g. data.cats to retrieve the contents of data/cats.lua. See DATA_FILE_EXTENSIONS for supported data formats.

params

params or P

Table for storing any custom data you want. Short form for page.params.

Clone this wiki locally