Creating pages

Page files

Pages are the files that are loaded, processed and saved in your site. You can create pages using different formats (md, js, ts, jsx, tsx, yml, etc) but the simplest way is by adding a Markdown file in the root directory with a suitable filename and .md as extension. Lume will load these files and generate HTML pages with them:

├──     => /index.html
├──     => /about/index.html
└──   => /contact/index.html

You can organize the pages into subdirectories, and this structure will be used also in the output of the site build:

├──        => /index.html
└── documentation
    └──     => /documentation/doc1/index.html
    └──     => /documentation/doc2/index.html

Pretty URLs

By default, all HTML pages will generate pretty URLs (URLs without the .html extension). This means that, instead of /about-us.html, the URL is /about-us/. This is done by saving all files as index.html and create all directories as needed.

If you want to disable it, set prettyUrls to false in config file, so you will have something like this:

├──        => /index.html
└── documentation
    └──     => /documentation/doc1.html
    └──     => /documentation/doc2.html

Page order

Pages are ordered by date, using the file creation date as default. If you want to have full control over this, you can assign the data by prepending it to the filename using the yyyy-mm-dd syntax following by an underscore _ (or yyyy-mm-dd-hh-ii-ss if you need also the time). Note that this part is removed to generate the final name:

├──                          => /index.html
└── posts
    └──     => /posts/hello-world/index.html
    └──  => /posts/my-second-post/index.html

If you don't mind the exact date, only want to keep an order, you can use just numbers:

├──                   => /index.html
└── docs
    └──   => /docs/getting-started/index.html
    └──      => /docs/installation/index.html
    └──         => /docs/downloads/index.html

Ignored pages

All files or directories starting with _ are ignored by lume to generate pages. This convention allows to place stuff that you don't want to include in your site output. This is the reason why the config file is _config.js, the output directory is _site, the includes directory is _includes, or shared data is named _data, all these things starts with an underscore so they are ignored on loading page files.

Dot files and directories (such as .git, .gitignore, etc) are also ignored.

Changing the output URL

You might want to have a particular directory structure for your source files that is different for the built site. With the url variable you change the output filename of any page (see Page data)