-
Notifications
You must be signed in to change notification settings - Fork 3
Objects
These are global objects.
These values can be configured in config.lua.
The base part of the website's URL, e.g. "http://www.example.com/".
The default layout pages will use.
The default value is "page" (which corresponds to the file layouts/page.html).
Setting this to an empty string will make pages use no layout by default.
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.)
The title of the website.
A list of URLs that point to previous locations of the current page. This serves the same purpose as config.redirections. Example:
{{
-- Current file: a-better-omelet.md
page.title = "Making a Better Omelet"
page.aliases = {"/how-to-make-omelet/", "/omelet-tutorial/"}
}}
The HTML contents of the current page. Available in layouts. Example:
<!-- layouts/page.html -->
<html>
<head>
<title>{{ page.title }}</title>
</head>
<body>
{{ page.content }}
</body>
</html>What date the page was created. See datetime for the date format. Also see page.publishDate.
If the current page is a draft. Drafts are excluded from the building process (unless the --drafts option is used).
If the current page is the root index page, aka the homepage.
If the current page is an index page.
If the current page is in fact a page. This value is true for HTML/Markdown files, and false for CSS files for example.
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.
What layout the page should use. The default is the value of site.defaultLayout. Setting this to an empty string will make the page not use any layout.
Table for storing any custom data you want. Also see the params/P aliases.
The permanent URL for the current page. This URL is absolute.
What date the page is published. If the date is in the future then the page is excluded from the build process. The default value is the value of page.date. See datetime for the date format.
On redirection pages, this value is set to the redirection target URL. Otherwise, it's empty.
The title of the current page. Every page should update this value.
The relative URL to the current page on the site.
Access data from the data folder.
Type e.g. data.cats to retrieve the contents of data/cats.lua or data/cats.toml.
See DATA_FILE_EXTENSIONS for supported data formats.
params or P
Table for storing any custom data you want. Aliases for page.params.
- Home
- Command Line
- Site Configuration
- Embedding Lua
- Constants
- Functions
- Objects
- Other Modules and Information