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

Richard Stallman 'Unveils' His January 20 Talk in Montpellier, France
It's free (gratis)
Links 19/01/2025: Gaza Ceasefire and PR Stunt by Fentanylware (TikTok), Faking It by "Going Dark" to Incite American Addicts (Users)
Links for the day
They Won't Buy Vista 11 PCs or "Hey Hi" Copilot+++++++ PCs of Microsoft (With TPM)
Windows at 8%
No Time Left for President Biden to Pardon Julian Assange
At least they tried
Total Lock-down Ambitions - Part IV - The Latest Examples and the Perils (in Summary)
For further reading take a look at Musial's nice outline
FOSDEM is Called "FOSDEM" Because of Richard Stallman (RMS)
The overlap there seems timely; yesterday RMS spoke in French-speaking (in part) Switzerland where questions in French were accepted
 
Gemini Links 20/01/2025: Magnetic Fields, NixOS, and Pleroma
Links for the day
BetaNews Spreads Donald Trump Propaganda, Promotes Scams, and Publishes Fake 'Articles' About "Linux"
This is typical BetaNews
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Sunday, January 19, 2025
IRC logs for Sunday, January 19, 2025
[Meme] Hardware RAID and Hardware Raid
We're expecting attacks on the press in Trump's second term (no need to impress anyone for another election cycle) to be far worse than the first
What's Running on the Laptops
12 months have passed
[Meme] 404, Not Found
Kuhn: I'd like to interject for a moment, we made an alliance with the Microsoft-dominated LF to outsource projects to Microsoft GitHub and rich people gave us money to do this
Links 19/01/2025: TikTok (Fentanylware) Now Banned in the US, Convicted Felon Talks to Fentanylware CEO and Pooh-Tin About Undoing the Ban Despite the Supreme Court Unanimously Upholding It
Links for the day
FTC Realises Microsoft Buying Fake 'Clients' to Fake "Revenue" (Microsoft 'Buying' Services and Products From Itself!)
Ponzi scheme
Total Lock-down Ambitions - Part III - The Web Browser as DRM Pusher
A lot of "streaming" stuff is DRM
Video: University in Peru Honours Richard Stallman
Tomorrow, January 20, Richard Stallman speaks in France
IBM Termination Story and Information From Microsoft About Mass Layoffs
In 2 weeks of 2025 Microsoft already had 2 waves of layoffs
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Saturday, January 18, 2025
IRC logs for Saturday, January 18, 2025
Links 18/01/2025: Restoring the Great Wall of China and Economic Expansion in China
Links for the day
Guardian Digital (linuxsecurity.com) is Spamming the Web With Microsoft's Promotional LLM Slop About UEFI 'Secure' Boot (Which is Against Real Security)
This is an attack on honest journalism
Links 18/01/2025: TikTok's Endgame, "Car Freedom", and Spying in Cars 'Fines' GM (Settlement)
Links for the day
January 20: Richard Stallman Talk in Europe
evening time in Europe, around midday in the United States and Canada
Links 18/01/2025: Apple Getting Out of Hey Hi (AI) Slop (Too Much Misinformation), Chaffbots/Chatbots Try to Settle Copyright Infringement Lawsuits
Links for the day
What Fake News Sites Are Doing to GNU/Linux
The LLM slop about Linux serves two purposes
Links 18/01/2025: Microsofters Upset at Microsoft's Ridiculous Rebrands (Excuse for Massive Price Hikes), Chaffbot Company ('Open'AI) Faces More Lawsuits
Links for the day
Gemini Links 18/01/2025: Surge in Illnesses, ctags, and Gemsync
Links for the day
Slopwatch: Too Lazy to Write Real Articles, Offloading to Chatbots Instead (LLM Slop About "Linux")
The Web was already full of garbage before the LLM frenzy. Now it's even worse.
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Friday, January 17, 2025
IRC logs for Friday, January 17, 2025