Search forms and server side search scripting?

Remco me at
Thu Feb 18 08:21:20 GMT 2021

2021/02/18 09:07, Lars Noodén:

> I've looked at the Gemini specification [1] and wonder where I can find
> information about receiving search or other input from the client.
> Perhaps I am missing something obvious, as I see that there are a
> growing number of interesting, searchable capsules [2] but have not yet
> seen how to do that.  My goal is to implement a local search function
> for a capsule being built.
> So I have two questions,
> 1) What markup should a gemini page contain to trigger an input dialog,
> and where may I see some sample code or pseudo code for the server-side?
>  If anyone has any sample- psuedo code to share, that would be
> wonderful.

Here's an example of a very basic CGI script written in Ruby:


It triggers a "10" response when there's no query set, otherwise it
returns a "20" response with links to all the files matching the query.
In this case it simple greps through the gemini directory.

Note, it doesn't do query string decoding so, depending on the server,
you might have to do some for "special" characters.

> 2) Which servers are light yet can still handle referrals to scripts, or
> is that best handled by a separate package and let the server deal with
> static pages only?

Any light server supporting CGI should be fine.


More information about the Gemini mailing list