.TH PAGE 1 "2025-10-01" "2.0.0" "Page Manual" .SH NAME page \- gemtext based static website generation tool for gemini and http. .SH SYNOPSIS .B page .SH DESCRIPTION .PP page is a tool that lets you create a static website from a directory of gemtext files. .PP To use, go to the directory containing the site, and run \fBpage\fR. It will create .B html and .B gemini directories inside .B $PAGE_OUTPUT_DIRECTORY/page/\fR, .B $XDG_CACHE_HOME/page/\fR, or .B ~/.cache/page/ in that order of precedence, where .B is the name of the current directory. .SH ENVIRONMENT VARIABLES You can configure the output location of the page using environment variables. .TP .B PAGE_OUTPUT_DIRECTORY Sets the location for the generated static files ready to be published. Defaults to \fI$XDG_CACHE_HOME/blog\fR, and falls back to \fI~/.cache/blog\fR. .SH FOLDER STRUCTURE The website directory has some requirements for page to work correctly. It must contain \fIgemtext\fR and a \fIlayout\fR, and optionally may contain static files. .SH GEMTEXT .P Any file with ending \fI.gmi\fR is interpreted as gemtext and will be parsed as html with the following rules: .TP \- The first two lines are checked for front matter .TP \- If the first or second line starts with \fB--- title:\fR, the text following will be treated as the title of the page and the line will be removed from the output. .TP \- If the first or second line starts with \fB--- description:\fR, the text following will be treated as the description of the page and the line will be removed from the output. .TP \- URLs that end with the extension \fI.gmi\fR will be replaced with \fI.html\fR unless the url begins with \fIgemini:\fR .P Example, this could be index.gmi. The first link will be converted to html but the second won't: .nf \f(CW --- title: Home --- description: Clemland is dedicated to all things sound # Welcome to Clemland My projects are located here: => /projects.gmi Projects This is a good gemini page: => gemini://r.bdr.sh/page.gmi \fR .fi .SH LAYOUT A file called _layout.html at the root of the element. It must be present. It should include the three following keywords, \fBexactly as shown\fR. .TP .B {{ title }} will get replaced with the front matter title of the gemtext file. .TP .B {{ description }} will get replaced with the front matter description of the gemtext file. .TP .B {{ content }} will get replaced with the body of the gemtext file. .P For example: .nf \f(CW Clemland {{ title }}
{{ content }}
\fR .fi .SH STATIC FILES Any file that isn't gemtext or the layout will be copied as-is. This includes hidden files! The only ones that are excluded are .git and .gitignore. .SH VERSION .BR 2.0.0 .SH HOMEPAGE .I https://r.bdr.sh/page.html .SH AUTHORS \ Rubén Beltrán del Río <\fIpage@r.bdr.sh\fP>