Pages

Blades loads all the TOML files (with the .toml extension) from the content directory specified in the config (defaults to content). In these files, the page content and metadata are provided. They are then rendered using the provided templates.

When the file is called index.toml, the corresponding page is called section. The rendered page (index.html) is displayed when the user browses to the parent URL. They can use some additional data in templates, such as their subpages and subsections. Other TOML files are treated as standard pages.

In pages, these variables can be specified (everything optional, default values shown):

# Title of the page title = "" # Date when the page was created date = None # date = 2020-09-08

# An image representing the page image = "" # A brief summary of the page content summary = "" # The main content of the page # CommonMark markdown can be used here content = """ """

# A template to render this page with. # If none is specified, the one specified in the parent section is used template = "" # A weight of the page, used if a collection this page is in is sorted by weight weight = 0 # A priority of this page for SEO, in the range of 0-1 priority = 0.5 # Hide the page from the list of its parent's subpages or subsections hidden = false

# A template to render the gallery pictures with gallery_template = "gallery.html"

# A list of pictures associated with this page # Each will be rendered into a separate gallery page [[pictures]] # Id string of the picture, used for the generated URL in the gallery page # MANDATORY for every picture used! pid = "" # An associated caption of the picture # CommonMark markdown can be used here caption = "" # An alternative text displayed when the image can't be loaded of for accessibility alt = "" # File name of the image file = "" # Date and time of when the image was taken taken = None # Repeat for every picture

# A map of lists to classify this page with [taxonomies] # For example: # tags = ["blades", "documentation"]

# Any "key = value" of any type can be used here for templates # CommonMark markdown can be used for string fields here [extra]

Sections

For pages that are sections, you can additionally specify these variables:

# A number of pages to paginate by, if this number is exceeded # If provided, must be a positive integer paginate_by = ∞ # A template to render every subpage with (unless it specifies another template) page_template = "page.html" # A template to render every subsection with (unless it specifies another template) section_template = "section.html" # Sort subpages and subsetions by their provided weight, low to high # By default, they are sorted by their date, newer to older sort_by_weight = false

Not sections

For pages that are not sections, you can additionally specify these variables (defaults are suggested):

# The path in the output directory this page is rendered into path = {{ parent directory of the page within the content directory }} # The file name this page is rendered into, without the .html extension slug = {{ file name without the extension }}