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

Bruce Perens & Debian public domain trademark promise
Reprinted with permission from disguised.work
Links 28/04/2024: Shareholders Worry "AI" Hype Brings No Income, Money Down the Drain
Links for the day
Lawyer won't lie for Molly de Blanc & Chris Lamb (mollamby)
Reprinted with permission from disguised.work
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Saturday, April 27, 2024
IRC logs for Saturday, April 27, 2024
Links 27/04/2024: Spying Under Fire, Intel in Trouble Again
Links for the day
Lucas Kanashiro & Debian/Canonical/Ubuntu female GSoC intern relationship
Reprinted with permission from disguised.work
Pranav Jain & Debian, DebConf, unfair rent boy rumors
Reprinted with permission from disguised.work
Links 27/04/2024: Kaiser Gave Patients' Data to Microsoft, "Microsoft Lost ‘Dream Job’ Status"
Links for the day
Gemini Links 27/04/2024: Sunrise Photos and Slow Productivity
Links for the day
Microsoft: Our "Goodwill" Gained Over 51 Billion Dollars in the Past Nine Months Alone, Now "Worth" as Much as All Our Physical Assets (Property and Equipment)
The makeup of a Ponzi scheme where the balance sheet has immaterial nonsense
Almost 2,700 New Posts Since Upgrading to Static Site 7 Months Ago, Still Getting More Productive Over Time
We've come a long way since last autumn
FSFE (Ja, Das Gulag Deutschland) Has Lost Its Tongue
Articles/month
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Friday, April 26, 2024
IRC logs for Friday, April 26, 2024
Overpaid lawyer & Debian miss WIPO deadline
Reprinted with permission from disguised.work
Brian Gupta & Debian: WIPO claim botched, suspended
Reprinted with permission from disguised.work
Microsoft's XBox is Dying (For Second Year in a Row Over 30% Drop in Hardware Sales)
they boast about fake numbers or very deliberately misleading numbers that represent two companies, not one
Ian Jackson & Debian reject mediation
Reprinted with permission from disguised.work
[Meme] Granting a Million Monopolies in Europe (to Non-European Companies) at Europe's Expense
Financialization of the EPO
Salary Adjustment Procedure at the EPO Challenged
the EPO must properly compensate staff in order to attract and retain suitably skilled examiners
How to get selected for Outreachy internships
Reprinted with permission from disguised.work
Links 26/04/2024: Surveillance Abundant, Restoring Net Neutrality Rules (US)
Links for the day
Gemini Links 26/04/2024: uConsole and EXWM and stdu 1.0.0
Links for the day
Red Hat Corporate Communications is "Red" Now
Also notice they offer just two options: MICROSOFT or... MICROSOFT!
Links 26/04/2024: XBox Sales Have Collapsed, Facebook's Shares Collapse Too
Links for the day
Albanian women, Brazilian women & Debian Outreachy racism under Chris Lamb
Reprinted with permission from disguised.work
Microsoft-Funded 'News' Site: XBox Hardware Revenue Declined by 31%
Ignore the ludicrous media spin
Mark Shuttleworth, Elio Qoshi & Debian/Ubuntu underage girls
Reprinted with permission from disguised.work
Karen Sandler, Outreachy & Debian Money in Albania
Reprinted with permission from disguised.work
Over at Tux Machines...
GNU/Linux news for the past day
IRC Proceedings: Thursday, April 25, 2024
IRC logs for Thursday, April 25, 2024
Links 26/04/2024: Facebook Collapses, Kangaroo Courts for Patents, BlizzCon Canceled Under Microsoft
Links for the day
Gemini Links 26/04/2024: Music, Philosophy, and Socialising
Links for the day