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

Facebook's Debt Leaps to Over 51 Billion Dollars
A lot of this is a bubble, aside from the bubble the media irresponsibly dubs "AI"
3 Days Ago Over at Tux Machines...
GNU/Linux news
Most of This Month Will Deal With EPO Scandals
A timeline of sorts
 
The Long-Coveted Milestone of 3,200 Active Gemini Capsules
Despite being away some days last week, about 50,000 Gemini requests were served each day, on average
Five More Days Till Techrights Party
We'll have many more batches of Daily Links as we catch up with a 'backlog' of news
Links 02/11/2025: More Nuclear Escalations and "Anti-Cybercrime Laws Are Being Weaponized to Repress Journalism"
Links for the day
Gemini Links 02/11/2025: "The Pragmatic Programmer", Perl New Features and Foostats
Links for the day
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Saturday, November 01, 2025
IRC logs for Saturday, November 01, 2025
Linux.com is Becoming Microsoft
They took a once-reputable site with a vast audience and turned it into a pile of trash
Microsoft Lunduke: People Pointing Out I'm a Bigot is a Badge of Honour
It's almost as if he openly admits being a troll and is proud of it
Oracle's Debt Continues Rising to All-Time Highs, The "Slop Bubble" is a Smokescreen for Larry Ellison
wishful-thinking bubble waiting to implode completely
News on the Web is Becoming Rare, Shallow, and Difficult to Find
To efficiently and rapidly find original and important news without underlying comprehension/understanding of the news (and its context) is a hard task
Slopwatch: Linux Journal, Serial Slopper, WebProNews, and More
getting back into the habit
The Cocaine Patent Office - Part III: European Patent Office Officials Cannot Claim False Identification
Corroborating with other sources is always desirable if possible. We shall do so later in this series.
Still Catching Up, Daily Links a Top Priority
Readers who have additional information about the EPO can send it along to us
Links 01/11/2025: "Americans Are Defaulting on Car Loans at an Alarming Rate" While Many Left to Starve (SNAP)
Links for the day
Gemini Links 01/11/2025: FIFO and Gemini Age Survey
Links for the day
Why Does German Media Protect the EPO From Accountability for Cocaine?
Can we trust such media to properly inform the public?
Links 01/11/2025: Microsoft Azure Goes Offline Again
Links for the day
Links 01/11/2025: Microsoft Distributes Malware Again, Radio Free Asia Shut Down by Dictator
Links for the day
November is Here, Anniversary Party This Coming Friday
Expect this site to return to its normal publication pace either by tomorrow or Monday
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Friday, October 31, 2025
IRC logs for Friday, October 31, 2025
Gemini Links 01/11/2025: Synergetic Disinformation and Software Maintenance
Links for the day
IRC Proceedings: Thursday, October 30, 2025
IRC logs for Thursday, October 30, 2025
IRC Proceedings: Wednesday, October 29, 2025
IRC logs for Wednesday, October 29, 2025