2 --- description: Page is a command-line tool that can generate a static website from gemtext.
5 Command line tool to generate a static website and gemini capsule from a directory with gemtext. Written in rust!
7 => https://git.r.bdr.sh/rbdr/page view source @ git.r.bdr.sh
8 => https://git.sr.ht/~rbdr/page source mirror @ sourcehut
13 You can install using homebrew.
16 % brew tap rbdr/apps git@git.sr.ht:~rbdr/homebrew-apps
17 % brew install rbdr/apps/page
21 Make sure you have rust and Make installed. Clone the repository, and run:
24 % make -e profile=release
27 Then copy the file somewhere in your PATH
30 % cp ./target/release/page /usr/local/bin
35 Go to the directory that contains your site and run page
38 % cd ~/projects/my_cool_page
42 It will create two directories at the parent directory, they will have the same name as the current one but appending _html and _gemini respectively.
51 These pages contain the static files ready to be uploaded with a tool like scp, rsync or however you move files.
55 The website directory has some requirements for page to work correctly.
59 Any file with ending .gmi is interpreted as gemtext and will be parsed as html with the following rules:
61 * The first two lines are checked for front matter
62 * If the first or second line starts with "--- title:", the text following will be treated as the title of the page and the line will be removed from the output.
63 * If the first or second line starts with "--- description:", the text following will be treated as the description of the page and the line will be removed from the output.
64 * URLs that end with the extension ".gmi" will be replaced with ".html" unless the url begins with "gemini:"
66 Example, this could be index.gmi. The first link will be converted to html but the second won't:
70 --- description: Clemland is dedicated to all things sound
74 My projects are located here:
76 => /projects.gmi Projects
78 This is a good gemini page:
80 => gemini://r.bdr.sh/page.gmi
85 A file called _layout.html at the root of the element. It must be present. It should include the three following keywords:
86 * {{ title }} will get replaced with the front matter title of the gemtext file.
87 * {{ description }} will get replaced with the front matter description of the gemtext file.
88 * {{ content }} will get replaced with the body of the gemtext file.
97 <meta charset="utf-8">
98 <meta name="viewport" content="width=device-width, initial-scale=1">
99 <meta name="author" content="Clem Fandango">
100 <meta name="description" content="{{ description }}">
102 <title>Clemland {{ title }}</title>
104 <link rel="stylesheet" type="text/css" href="/style.css">
116 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.
120 * 1.3.1 Don't add closing slash to line breaks
121 * 1.3.0 Adds support for specifying alt-text for preformatted text blocks.
122 * 1.2.0 Wraps headings in a div to make certain layout operations easier.
123 * 1.1.0 Adds front matter for title and description, generates gemini and http directories.