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

BetaNews is Run and Written by Bots That Make Clickbait
At least one author is doing this
Technology: rights or responsibilities? - Part VIII
By Dr. Andy Farnell
GNU/Linux Reaches All-Time High in Europe (at 6%)
many in Europe chose to explore something else, something freedom-respecting
Techrights' Statement on Code of Censorship (CoC) and Kent Overstreet: This Was the Real Purpose of Censorship Agreements All Along
Bombing people is OK (if you sponsor the key organisations), opposing bombings is not (a CoC in a nutshell)
 
On Groupthink, Mindless 'Sheep', and Toxic Online Cults
This week, treat yourself to a life free of social control media
[Meme] Microsoft: Our "Hey Hi" Hype is Going So Well That We Have MASS Layoffs Every Month. Makes Sense?
Contradiction
Latest Mass Layoffs at Microsoft Are Confirmed, Bing and Vista 11 Losing Market Share
They tried to hide this. They misuse NDAs.
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Sunday, November 24, 2024
IRC logs for Sunday, November 24, 2024
Gemini Links 25/11/2024: Purity and Cory Doctorow's Ulysses Pact, Smolnet Portal and SGI
Links for the day
Patents Against Energy Sources That Reduce Pollution
this EV space (not just charging) is a patent mine field and it has long been that way
DARPA’s Information Innovation Office, Howard Shrobe, Values Compartmentalisation But Loses the Opportunity to Promote GNU/Linux and BSDs
All in all, he misses an opportunity
Wayland is an Alternative to X
the alternative to X (as in Twitter) isn't social control media but something like IRC
BetaNews, Desperate for Clicks, is Pushing Donald Trump Spam Created by LLMs (Slop)
Big clap to Brian Fagioli for stuffing a "tech" site with Trump spam (not the first time he uses LLMs to do this)
[Meme] Social Control Media Bliss
"My tree is bigger than yours"
Links 24/11/2024: More IMF Bailouts and Net Client Freedom
Links for the day
Gemini Links 24/11/2024: Being a Student and Digital Downsizing
Links for the day
[Meme] The Most Liberal Company
"Insurrection? What insurrection?"
apple.com Traffic Down Over 7%, Says One Spyware Firm; Apple's Liabilities Increased Over 6% to $308,030,000,000
Apple is also about 120 billion dollars in debt
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Saturday, November 23, 2024
IRC logs for Saturday, November 23, 2024
[Meme] GAFAMfox
Mozilla Firefox in a state of extreme distress
Google Can Kill Mozilla Any Time It Wants
That gives Google far too much power over its rival... There are already many sites that refuse to work with Firefox or explicitly say Firefox isn't supported
Free (as in Freedom) Software Helps Tackle the Software Liability Issue, It Lets Users Exercise Greater Control Over Programs
Microsofters have been trying to ban or exclude Free software
In the US, Patent Laws Are Up for Sale
This problem is a lot bigger than just patents
ESET Finds Rootkits, Does Not Explain How They Get Installed, Media Says It Means "Previously Unknown Linux Backdoors" (Useful Distraction From CALEA and CALEA2)
FUD watch
Techdirt Loses Its Objectivity in Pursuit of Money
The more concerning aspects are coverage of GAFAM and Microsoft in particular
Links 23/11/2024: Press Sold to Vultures, New LLM Blunders
Links for the day
Links 23/11/2024: "Relationship with Oneself" and Yretek.com is Back
Links for the day
Links 23/11/2024: "Real World" Cracked and UK Online Safety Act is Law
Links for the day
Links 23/11/2024: Celebrating Proprietary Bluesky (False Choice, Same Issues) and Software Patents Squashed
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Friday, November 22, 2024
IRC logs for Friday, November 22, 2024
Gemini Links 23/11/2024: 150 Day Streak in Duolingo and ICBMs
Links for the day