Bonum Certa Men Certa

Modifying WordPress to Include Gemini Links in All Articles (Assuming a Canonical URL Form)

Links



Summary: In order to promote the departure from the World Wide Web (where possible and suitable; sites with text don't typically need Web-like features) one can promote the analogous pages in one's Gemini capsule; we suggest a way of doing so in WordPress (the most widely used CMS)

Different sites implement their Gemini (protocol) version differently. We intend to publish all the source code we've produced under the AGPLv3. In the meantime, for WordPress itself, here's what it takes to display to readers the analogous page/address in Gemini. Canonical links are assumed.



"The Web as a whole is problematic and it would help to have the FSF promote Gemini."The change typically requires using one's template of choice (WordPress has templates to separate changes from the "core"). In our case, we've edited single.php to include the Gemini page of a given "single" post. For a site that just uses another protocol but the same URL structure the following may do:

<?php $permalink = get_permalink(); $find = array( 'http://', 'https://' ); $replace = ''; $output = str_replace( $find, $replace, $permalink ); echo '<p>gemini://' . $output . '</p>'; ?>

Change the 'smart' quotes to something "normal".

They key is removing the http/https part, then replacing it with something else ("gemini://gemini." in our case). There's also the preg_replace approach, but it can get a tad problematic:

<?php $gemini = preg_replace('http', '', get_permalink()); echo $gemini; ?>

LinkIn Techrights we've used

<?php $permalink = get_permalink(); $find = array( 'http://', 'https://' ); $replace = ''; $output = str_replace( $find, $replace, $permalink ); echo '<p>This post is also available in <a href="http://techrights.org/gemini/" title="Techrights on Gemini">Gemini</a> over at:</p> <p><u>gemini://gemini.' . $output . '</u></p>'; ?>

It has meanwhile emerged that the FSF, perhaps belatedly, realised that Twitter is no longer acceptable. For reasons we've mentioned since November of last year. The Web as a whole is problematic and it would help to have the FSF promote Gemini. The FSF mostly uses Drupal as a CMS.

Recent Techrights' Posts

SLAPP Censorship - Part 80 Out of 200: Having Run Out of Time to Meet a Judge's Deadline, Microsoft's Graveley Had Garrett's Lawyers Argued My ~190-Page Defence and CounterClaim (DCC) Was Unclear About My Position
Nothing could be further from the truth
 
The Slop Bubble is Already Bursting
Slop is not desirable and the general public is growingly impatient, seeing that slop has improved nothing for them
Gemini Links 19/05/2026: Reliable Old Tech, Collection of Essays
Links for the day
The Corrupt Lecture the Non-Corrupt - Part XXVII - European Patent Office (EPO) Became a "Toxic Work Environment" When Cocaine Addicts Put in Charge
They are putting at risk colleagues by abusing them
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Monday, May 18, 2026
IRC logs for Monday, May 18, 2026
Links 18/05/2026: Slop-induced Shortages, Solicitors Regulation Authority Says It's Unable to Deal With Complaints Load (So Regulation Does Not Really Exist)
Links for the day
Gemini Links 18/05/2026: Ghost Essay and World Wide Web Considered Broken
Links for the day
Cooperation and Collaboration, on a More Personal Level
Rianne, to me, isn't just a wife; she is also my best friend
IBM Has Payroll Problems (Just Like Microsoft)
It's a good thing that many nations around the world are, accordingly if not proactively, divesting from GAFAM
Links 18/05/2026: 25 Years of OLDaily and Dangers of "Living With Too Much Tech"
Links for the day
Trips to London
London isn't a bad place, but it's a long journey and we'd rather stay in Manchester and write about technology
Working in the Shell (and Fish)
Yesterday we spent about 5 hours on the shells and fish
The Corrupt Lecture the Non-Corrupt - Part XXVI - Campinos Has Put Unfit-for-Employment Drug Addicts in Charge of the European Patent Office (EPO)
How many months has Campinos got left before the delegates show him the door?
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Sunday, May 17, 2026
IRC logs for Sunday, May 17, 2026
Gemini Links 18/05/2026: Poetry, Sauna, and GNU Taler
Links for the day
"The Society of Media Lawyers" (UK) is a Truly Malicious Anti-Media Lobby Which Helps Rich/Abusive Americans and Hostile Countries Attack Actual Media Workers in the UK
They typically source their money from aboard to besiege domestic actors (like honest journalists or independent outlets that document suppressed beats/topics)
Slop Still Waning, Its Momentum is Driven by Companies That Stand to Lose a Lot (or Everything) When the Bubble Pops
When it comes to LLM slop disguised as news, it's just not working out
Gemini Links 17/05/2026: arXiv Brings Down the Hammer, UnderPOWERed, and Slopping With Tcl/Tk
Links for the day
Links 17/05/2026: Amazon Employees Herded Into Slop, Taiwan Sold Down the River by Cheeto
Links for the day
Links 17/05/2026: Society of Media Lawyers (Brett Wilson LLP et al) Lobby for More SLAPPs in the UK, “Courage in Journalism Award” Given in Oppressive Country
Links for the day
Finland Needs to Dump Microsoft (Microslop) for National Security Reasons and the Same is True for Hundreds of Countries
"I don't see why Ryssäs would want Finns to use microslop products..."
Cyber Show UK is Already Available Over Gemini Protocol
This past week the total number of active Gemini capsules hit all-time records several times
Fight Til the End
This comes to show that persistence pays off
SLAPP Censorship - Part 79 Out of 200: They Will Soon Reach the 100 KG (Kilograms) Milestone; Wheelbarrows, Not Justice (Quantity of Legal Papers Sent to Us)
It's about the quality, not quantity (unless your sole aim is to drown out or "flood the zone")
The Corrupt Lecture the Non-Corrupt - Part XXV - Not Bringing Intelligence to the EPO, Not 'Artificial Intelligence' Either (But Intelligence-Eroding Drugs)
The EPO was meant to be about science and law. In practice, however, it's about breaking the law and being stoned.
The Cyber Show on Why Coding is Important and Slop Cannot Change or Replace That
Hand-crafting one's site has plenty of advantages
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Saturday, May 16, 2026
IRC logs for Saturday, May 16, 2026
Gemini Links 17/05/2026: Music Theory, Reticulum Git Repos, and Releasing Kiln
Links for the day