agate

Simple gemini server for static files
git clone https://github.com/mbrubeck/agate.git
Log | Files | Refs | README

commit f7ac1fe21bf279036df68e36d96ad1bf640c83fd
parent c916827709a10d428cb55d30dc9a06a83954289d
Author: Johann150 <johann.galle@protonmail.com>
Date:   Mon,  4 Jan 2021 21:53:12 +0100

update readme

Diffstat:
MREADME.md | 11+++++++++++
Msrc/metadata.rs | 2+-
2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md @@ -43,6 +43,17 @@ All of the command-line arguments are optional. Run `agate --help` to see the d When a client requests the URL `gemini://example.com/foo/bar`, Agate will respond with the file at `path/to/content/foo/bar`. If any segment of the requested path starts with a dot, agate will respond with a status code 52, even if the file does not exist (this behaviour can be disabled with `--serve-secret`). If there is a directory at that path, Agate will look for a file named `index.gmi` inside that directory. If there is no such file, but a file named `.directory-listing-ok` exists inside that directory, a basic directory listing is displayed. Files or directories whose name starts with a dot (e.g. the `.directory-listing-ok` file itself) are omitted from the list. +Agate will look for a file called `.lang` in the same directory as the file currently being served. If this file exists and has an entry for the current file, the respective data will be used to formulate the response header. +The lines of the file should have this format: + +```text +<filename>:<metadata> +``` + +Where `<filename>` is just a filename (not a path) of a file in the same directory, and `<metadata>` is the metadata to be stored. +Lines that start with optional whitespace and `#` are ignored, as are lines that do not fit the above basic format. +Both parts are stripped of any leading and/or trailing whitespace. + [Gemini]: https://gemini.circumlunar.space/ [Rust]: https://www.rust-lang.org/ [home]: gemini://gem.limpet.net/agate/ diff --git a/src/metadata.rs b/src/metadata.rs @@ -8,7 +8,7 @@ use std::time::SystemTime; /// /// These sidecar file's lines should have the format /// ```text -/// <filename>:<metadata>\n +/// <filename>:<metadata> /// ``` /// where `<filename>` is only a filename (not a path) of a file that resides /// in the same directory and `<metadata>` is the metadata to be stored.