The site file
The site file, site.fm by default, names the pages and the look of a site. It has the form of ztcl.project: one key and its value on each line. A value in braces can go on more lines. A line that starts with # is a comment.
format 1
title Basic
url https://example.com/basic/
description {A small site of Flight Manual.}
assets {docs/images images}
pages {
group Start
docs/index.md
docs/install.md
group Guide
docs/guide/first-site.md guide/first-site/ "A first site"
}
A key that is not in this list is an error. A key can be in the file one time.
The paths of the keys docs, assets, and the pages are relative to the source folder: the folder of the option -root of build, or the folder of the site file. The paths of pages (a file), style (a folder), and plugins are relative to the folder of the site file.
The keys
| Key | Value | Default |
|---|---|---|
format |
1. It must be the first key. |
none: the key must be there |
title |
The name of the site. It is the text of the link to the start page, and the end of the title of each page. | none: the key must be there |
url |
The URL of the site, with http:// or https:// and a / at the end. Each page has a canonical link to this URL and its page path. |
none: the key must be there |
lang |
The language of the pages, for <html lang>. |
en |
description |
The meta description of a page with no paragraph. A page with a paragraph has the text of its first paragraph, cut at 160 characters. | empty |
docs |
The folder of the pages. With no pages, each .md file in it is a page. The default page path of a file is its path in this folder. |
docs |
pages |
The list of pages (below), or the name of a file that has the list. A value of one word that ends with .fm is a file. |
each .md file of docs, in the order of their paths |
style |
The look of the site: the name of a built-in style, or a folder of the site (Templates). | modern |
search |
The kind of search. json (or 1) is the search page search/, the index search.json, and the form of the slot {{search}}. 0 turns the search off. (Search) |
json |
html |
Raw HTML of a page. escape writes it as text. keep writes it as HTML, also <iframe> and <script> (no tag filter of GitHub): use it only when each page comes from a person that you trust, because a <script> of a page then runs in the browser of each reader. |
escape |
repo |
The URL of the repository of the source folder, such as https://github.com/NAME/REPO. A link to a file of the source folder that is not part of the site goes to its page in the repository: REPO/blob/BRANCH/PATH, or REPO/tree/BRANCH/PATH for a folder. With no repo, such a link is an error. |
none |
branch |
The branch of the links of repo. |
main |
summary |
The summary of the site for llms.txt and llms-full.txt. With no summary, the build does not write them. |
none |
logo |
A file .svg or .png of the site: the logo. The build copies it to assets/, and the slot {{logo}} of the built-in styles shows it at 26 px before the name of the site. |
none |
icons |
Files .svg, .png, or .ico of the site: the icons of the tab and of the home screen. The build copies each to assets/ and gives each page a link to each one. They replace the icon of the style. The name gives the kind: apple-touch-icon.png is the icon of the home screen of a phone, and favicon-32.png has the size 32 by 32. |
the icon of the style |
image |
The picture of the card of a link in a chat or on a social site, as a URL or a path of the site, such as social.png. With image, each page has the meta tags og: of the title, the description, the URL, and the picture, and a large card for twitter:card. The build does not copy the file: give it a pair in assets. |
none: no card |
parts |
The form of a part of a group of the menu (group NAME/PART). labels: the part is a small heading in the group. details: the part is a group of its own after the group, with the class sub, closed except on a page of the part. A group is then open only on a page of the group that is in no part. |
labels |
plugins |
The plugin files of the site (Plugins). | none |
allow |
The capabilities of the plugins: file gives them the files of the source folder. |
none |
panel |
1 turns on the panel of the search field: the best results drop down while the reader types (Search). It needs the search. |
0 |
groups |
The order of the first groups of the results of the search, such as {Commands Guides}. The other groups follow in the order of the menu. |
the order of the menu |
ztcl |
A folder of the source with a newer ztcl-host.wasm and ztcl.mjs for the panel. |
the files of Flight Manual |
reference |
A folder of a command reference in the format of ztcl, and the folder of its pages, such as {docs/reference reference}. Each command, option, and subcommand of the files .tcl of the folder is an entry of the index of the search, with the anchor of each option. A file whose name starts with _ is not read. (Search) |
none |
kinds |
The order of the kinds of the entries of the search, such as {command heading}. The other kinds follow in their default order. A name that is not a kind adds one, for the page key entry. (Search) |
command option subcommand guide heading text |
assets |
Pairs of a source and a folder of the output. A source file goes into the folder: {docs/guide/bell.png guide} writes guide/bell.png. The files of a source folder go into the folder, with their paths: {docs/images images}. Only the pages and the assets go to the output, so a picture next to a page needs a pair too. |
none |
The list of pages
The list has one page on each line:
FILE ?PATH? ?LABEL?
FILEis a Markdown file, relative to the source folder. It can be outside the folderdocs, such asREADME.mdat the top of a project.PATHis the page path:""for the start page, a folder that ends with/, or a file that ends with.html. The default is the path of the file in the folderdocs, with no.md, as a folder.README.mdandindex.mdare the page of their folder. Sodocs/install.mdis the pageinstall/, anddocs/index.mdis the start page. A file outside the folderdocshas its path from the source folder:README.mdis the start page, andCHANGELOG.mdis the pageCHANGELOG/.LABELis the text of the page in the menu. The default is the first heading of the page. To give a label with the default path, write the path:docs/install.md install/ "Get it".
A word with spaces goes in quotes or braces, as in Tcl. The line group NAME starts a group of the menu, and each page after it is in the group. A file or a page path can be in the list one time.
The order of the list is the order of the menu.
Examples
Each key is in a site file of examples/, which CI builds with -strict:
| Key | Example |
|---|---|
format, title, url, description |
each example |
lang |
style/site.fm |
docs |
the default docs: plugin/site.fm |
pages |
basic/site.fm, readme/site.fm |
style |
style/site.fm |
assets |
basic/site.fm |
search |
search 0: commands/site.fm |
repo, branch, summary |
readme/site.fm |
plugins, allow |
api/site.fm, plugin/site.fm |
Examples shows each site.
Next: Styles and templates.