The optional scheme in URLs

Alex Schroeder alex at gnu.org
Mon Aug 24 14:24:36 BST 2020


A few sites out there offer both Gemini and web access. That's cool.
It's a bridge to Gemini space. At first, as a developer who had written
just such a tool, I was exasperated: should I be linking to Gemini URLs
or to web URLs, or both? Or translate them automatically in the
background?

It turns out, this is not required. Just now, for example, I added link
like the following:

=> //flounder.online/ Flounder, for simple web people

The magic of URLs is that the actual target depends on what you're
looking at: If you're looking at 
https://transjovian.org:1965/gemini/page/Sites then the link goes to 
https://flounder.online/ and when you're looking at
gemini://transjovian.org/gemini/page/Sites then the link goes to
gemini://flounder.online/.

Now I'm just taking extra care such that as many URLs as possible are
reachable using either scheme. If they are, then I can link to these
resources without specifying a scheme and it'll just work.

Cheers
Alex





More information about the Gemini mailing list