💾 Archived View for tilde.cafe › ~winter › gemlog › 2022-07-08_dgmi.dgmi captured on 2023-06-16 at 16:24:18. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-06-14)

➡️ Next capture (2023-07-10)

🚧 View Differences

-=-=-=-=-=-=-

Dynamic Gemtext with dgmi

dgmi is a simple tool I threw together that provides PHP-like functionality for gemini. It's basically gemtext but with inline CGI, so you get the convenience of gemtext with the power of CGI.

Here is an example of it in action, using bash to show the current date (try reloading the page):

The current date and time is Fri Jun 16 16:24:18 EDT 2023.

Here is an example of generating more natural-looking text and using environment vars:

You haven't set a query string. Try appending one to the URL.

This page's source code, so you can see how to use it

In short:

This bash script is kinda slow, so if anyone can be bothered, I would be interested to see a faster implementation in another language!

Update: the bash script is less slow now - I changed it to use built in substring matching instead of calling grep on every line :)

Download dgmi.bash

Send me an email if you find this useful