Documentation
Documentation is a kind of post laid out as a tree of pages, for guides, manuals and handbooks. It lives on the same Site as your other pages: nothing separate to build or host. Visitors get a sidebar of every page, the path to the page they are on, a list of its headings, and links to the previous and next pages.
Set up a documentation
CMS Managers open Posts, select Add a kind of post and give:
- Name in Thai and Name in English, such as คู่มือ and Guides.
- Address, such as
docs: its first page is at/th/docsand/en/docs. - Layout: Documentation.
The layout stays as it is once the documentation has pages. A Site can have more than one documentation, each with its own address.
Write a page
Choose the documentation's tab and select New page, or open a page's menu in the tree and select Add a page under it, which starts the address for you. A page is written like any other page: title, blocks, preview, history, publishing and languages. It has no date, cover picture, categories or tags.
Address is the page's place in the documentation, in one to three parts:
catalogingis a first-level page, a section.cataloging/marc-editoris a page under it.cataloging/marc-editor/leaderis a page under that one.
Write the section's page first, then the pages under it. A page whose section isn't published yet shows one level up until it is.
Under Address, the editor shows where the page is in the documentation: the sections above it, each a link to its page. If a section has no page in this language yet, a warning says so, which also catches a mistyped address. Show in the tree opens the documentation's tree in the page's language.
A new page goes last among the pages of its level. The same page in the other language keeps the same place.
Import from Markdown
CMS Managers can bring in documentation written as Markdown files, as Hugo, Docusaurus, Starlight, VitePress, MkDocs, GitBook and similar tools keep it. On the documentation's tab, select Import Markdown, then Choose folder or Choose .zip (such as a repository downloaded from GitHub).
Before anything is made, the dialog lists the pages in the order they will have, each with what won't come across. Check:
- Language of the pages: the import makes one language; import the other language's folder again in that language, at the same addresses, to add its translations.
- Top of the documentation: the folder its sections are in. Its own index page is left out: the documentation's first page lists its sections.
- Old address of this documentation: where its pages were on the old website, such as
/docs, when that address now comes to this Site. Each page's old address then sends visitors on to its new one. Leave it empty if the old website stays where it is. - Add redirects from the old addresses now: shown when there are any, from the field above and from the files' own
aliasesorredirect_from. Redirects work at once, so add them when the old addresses point to this Site; they are listed in Redirects.
What comes across:
- Pages and sections: a folder is a section, its
index.md,_index.mdorREADME.mdits page. A folder without one gets an empty page for its title. Addresses come from the file and folder names; a fourth level joins into the third. - Order: front matter
weight,sidebar_position,sidebar.order,orderornav_order; a folder's_category_.jsonand a_meta.json; a number before a name, such as01-intro.md; then by name. Title and Summary come fromtitleanddescription, else the first heading. - Blocks: text, headings, lists, tables and code;
```mermaidas a diagram; callouts, tabs and steps in each tool's own way (> [!NOTE],:::tip,!!! warning,<Tabs>,=== "Tab", Hugo's callout, tabs and steps shortcodes, and the like). Links to other files become links to their pages; pictures in the folder go into Media (folder Import), each once. - Left out: MDX imports and components it doesn't know, and HTML beyond its words.
Every page arrives as a draft. A page whose address is already taken is skipped, never replaced, so importing the same folder again only adds what is new.
Documentation blocks
Add a block has a Documentation group. Its blocks work on any page or post, not only in a documentation:
flowchart LR
A[Draft] --> B{Review}
B -- Approve --> C[Published]In any text, the toolbar's Inline code marks a few words as code, such as a command or a field name.
Arrange the pages
The documentation's tab shows its pages as a tree, in the order the Site's sidebar lists them, one language at a time: choose a language above it, which shows how many pages each has. It opens in the Site's own language, or in one that has pages when that one has none yet. Searching by title or address shows a plain list instead.
A page shows Not in and the languages it isn't in yet, and a line above the tree counts the pages missing from the language shown. To add one, show a language that has it and use Duplicate… on it.
CMS Managers arrange the tree:
- Reorder a level: drag a page by its handle to another place among the pages of its level, or open its menu and select Move up or Move down. The pages under it go with it.
- Move to another place: open the page's menu, select Move to… and choose the page to put it under, or the top level. The page moves with every page under it, in every language; it goes last there, and its old addresses send visitors on to the new ones. A place is offered only if the pages it brings along still fit in three levels.
The order is the same in every language, and both changes show on the Site within a minute, without publishing. A page someone else is editing can't be moved until they finish.
To change only the last part of a page's address, open the page and change Address in Page settings; pages under it do not follow, so move those with Move to… first.
Duplicate a page
Anyone who writes in CMS can open a page's menu in the tree and select Duplicate…, then tick one or more of:
- Here: a copy beside the page, in the same language, at its address with
-copyadded and (copy) after its title. Change its title and Address before you publish it. - Into another language: each of the Site's languages the page isn't in yet. The copy has the same address, so it becomes the page's translation, and keeps the page's place in the tree. Translate its words, then publish it.
Every copy starts as a draft with the page's title and blocks. A page with pages under it also offers With the pages under it: tick it to copy the whole section. Here, the copy of the section goes beside it and the pages under it keep their titles under its new address. Into another language, each language gets the pages of the section it doesn't have yet. Left unticked, only the page itself is copied. One duplicate makes at most 200 pages.
What visitors see
- The first page, at the documentation's address: each section with its summary and the pages under it. A page's Summary is what shows there.
- The sidebar: every published page. A large documentation shows only the branch the visitor is in, and the others open with their arrows. On phones it opens from Menu.
- On this page: the page's headings, beside the page on wide screens and folded above it on smaller ones.
- Previous and Next, in the sidebar's order, and the date the page was last updated.
- Pages in other languages: when some published pages aren't in the visitor's language yet, the sidebar and the first page say how many there are in each other language, with a link to the documentation in that language.
- Search: a field at the top of the sidebar searches this documentation only. As visitors type, a dialog lists the pages that hold the words, with the words around each match and the heading they are under; choosing one opens the page at that heading. Ctrl K (⌘K on a Mac) opens it from anywhere in the documentation, the arrow keys move through the pages found, and See all results opens the full list. Without script the field goes straight to that list. A newly published page can take a minute to be found.
Published pages are also found by the Site's own search, which also links to the heading the words are under, and listed in its sitemap. Add the documentation to the Site's menus as a link, such as /th/docs.
Updated