💾 Archived View for gemini.unlimited.pizza › page.gmi captured on 2024-02-05 at 09:32:22. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
Command line tool to generate a static website and gemini capsule from a directory with gemtext. Written in rust!
You can install using homebrew.
% brew tap rbdr/apps git@git.sr.ht:~rbdr/homebrew-apps % brew install rbdr/apps/page
Make sure you have rust and Make installed. Clone the repository, and run:
% make -e profile=release
Then copy the file somewhere in your PATH
% cp ./target/release/page /usr/local/bin
Go to the directory that contains your site and run page
% cd ~/projects/my_cool_page % page
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.
% ls ~/projects my_cool_page/ my_cool_page_gemini/ my_cool_page_html/
These pages contain the static files ready to be uploaded with a tool like scp, rsync or however you move files.
The website directory has some requirements for page to work correctly.
Any file with ending .gmi is interpreted as gemtext and will be parsed as html with the following rules:
Example, this could be index.gmi. The first link will be converted to html but the second won't:
--- 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://gemini.unlimited.pizza/page.gmi
A file called _layout.html at the root of the element. It must be present. It should include the three following keywords:
For example:
<!DOCTYPE HTML> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="author" content="Clem Fandango"> <meta name="description" content="{{ description }}"> <title>Clemland {{ title }}</title> <link rel="stylesheet" type="text/css" href="/style.css"> </head> <body> <main> {{ content }} </main> </body> </html>
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.