2025-11-03 Gemini and Gopher support for this site ================================================== This blog is also accessible via Gemini and Gopher. I recently did some tinkering with my Patched Satellite and my Markdown Gopher to get things working for my 2025 Portugal post. The main problem was that if I link to the directory (2025-portugal) then the web redirects to the index file (index). Patched Satellite didn't do this. It tried to read the index.gmi file that wasn't there. The first fix was to read the index.md fix if possible. But that still didn't work because all the images didn't load. This has to do with relative URLs. If the page 2025-portugal/index links to a local file, say image.jpg, then the result is 2025-portugal/image.jpg. But if 2025-portugal just reads the index file in the background, then the result of the link is image.jpg! The browser computes the link target based on its current URL and reading a file from a subdirectory without telling the browser breaks all these links. So I needed either some processing for all links, or a redirect from 2025-portugal to 2025-portugal/index. And that's what I did. For Markdown Gopher the problem was worse: By default, when visiting a directory, it takes the index file and tries to show a menu with all the "linked list items". This works well if the file called "index" actually is an index to other pages. But in the 2025 Portugal case, the index page is just a page with regular links. The menu was effectively empty, resulting in an empty response. I was very confused. What I'm doing now is I count the number of "linked list items". If that number is 0, I create return a single menu line saying "please follow this redirect" (manually!) to the same index file, but now using item type 0 (text) instead of item type 1 (menu). There probably a way to fix this by moving the decision "up" to the menu above. When displaying the main page, I could check every local link target and if it points to a directory, check the index file, and if it doesn't have "linked list items" create a text item, otherwise a menu item. That seems like a lot of compute for a relatively rare situation. So for the moment, "manual redirects" it is. #Gemini #Gopher