Wednesday, January 04, 2023
Thoughts on an implementation of Gemini mentions
The other day I didn't have much to say about the Gemini Mentions proposal. Now that I've implemented it for my Gemini site (the code has been upated extensively since the other day), I have more thoughts.
First, having the location locked to /.well-known/mention
works fine for single-user sites,
but it doesn't work that well for sites that host multiple users under a single domain.
Alice who has pages under gemini://example.com/alice/
and want to participate with Gemini mentions.
So might Dave under gemini://example.com/dave/
.
Bob,
who has pages under gemini://example.com/bob/
doesn't care,
nor does Carol,
under gemini://example.com/carol/
.
How to manage gemini://example.com/.well-known/mentions
where half the users want it,
and the other half don't?
Having the ability to specify individual endpoints,
say with a CGI script,
would at least let Alice and Dave participate without having to bug the example.com
admin to install a service under a single location.
Second,
not every person may want to have every page to receive a mention.
I know I don't—I want to restrict mentions to the blog portion of my Gemini site.
The proposal only states that “a capsule owner MUST implement a basic endpoint: /.well-known/mention
,”
but it says nothing about limiting what pages can be the target of a mention.
I suppose having a link to /.well-known/mentions
on a page could indicate that page can receive mentions,
but the implication is that the endpoint link doesn't have to be mentioned at all.
For now,
I just filter requests to my blog entries and for other pages I return a “bad request.”
Third, I'm still unsure about sending a single URI. My implementation does scan the given URI for links to my blog, and will grab the first link that matches a blog entry from the URI (and ignores other links to my Gemini site—see point above). Sending in two links, as in a webmention provides some form of check on the request.
Fourth, I don't check for the “RE:” in the link text as I don't think it's needed. The specification implies it has to be “RE:” (in all caps), but I can see “Re:” and “re:” being used as well, because humans are going to human and be lazy (or trollish and use “rE:” just to mess with people; or not include it at all).
I also did a second implemenation that addresses all these points (and the code for this version is very similar to the other one). I guess I'll see which one becomes more popular.