💾 Archived View for tilde.cafe › ~winter › cgi-bin › cat.sh › gemlog › 2022-07-08_dgmi.dgmi captured on 2022-07-16 at 21:28:45.
-=-=-=-=-=-=-
#!/home/winter/public_gemini/cgi-bin/dgmi.bash # 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): :::/bin/bash echo "> The current date and time is `date`." ::: Here is an example of generating more natural-looking text and using environment vars: :::bash if [ -z "$QUERY_STRING" ] then echo "You haven't set a query string. Try appending one to the URL." else echo "Thanks! Your query '$QUERY_STRING' has been successfully discarded." fi ::: => ../cgi-bin/cat.sh/gemlog/2022-07-08_dgmi.dgmi This page's source code, so you can see how to use it In short: