build/email-subjects (#5281)
continuous-integration/drone/push Build is passing

Allow specifying a subject in our email element.

Eg the xhtml content
```xml
<email mailto="yes" subject="Ada and Zangemann">contact@fsfe.org</email>
```

Will now generate
```xml
<a href="mailto:contact@fsfe.org?subject=Ada and Zangemann">contact@fsfe.org</a>
```
Which when clicked will open an email client, and correctly populate the subject.

I also added the subject to all ada zangemann pages, and have documented it on the web features page.

Resolves #2742

Co-authored-by: Darragh Elliott <me@delliott.net>
Reviewed-on: #5281
Co-authored-by: delliott <delliott@fsfe.org>
Co-committed-by: delliott <delliott@fsfe.org>
This commit was merged in pull request #5281.
This commit is contained in:
2025-09-08 05:46:53 +00:00
committed by tobiasd
parent b523e45db4
commit 235d86bed9
7 changed files with 16 additions and 6 deletions
+6
View File
@@ -8,6 +8,7 @@
<xsl:template name="email" match="email">
<xsl:param name="email" select="."/>
<xsl:param name="mailto" select="@mailto"/>
<xsl:param name="subject" select="@subject"/>
<!-- Split email on each character, creating a <token>character</token> element each -->
<xsl:variable name="email-tokens">
<xsl:call-template name="tokenize">
@@ -85,6 +86,11 @@
-->
<xsl:text disable-output-escaping="yes">&lt;a href="mailto:</xsl:text>
<xsl:value-of select="$email-encoded" disable-output-escaping="yes"/>
<xsl:text>?</xsl:text>
<xsl:if test="$subject">
<xsl:text>subject=</xsl:text>
<xsl:value-of select="$subject"/>
</xsl:if>
<xsl:text disable-output-escaping="yes">"&gt;</xsl:text>
<xsl:value-of select="$email-encoded" disable-output-escaping="yes"/>
<xsl:text disable-output-escaping="yes">&lt;/a&gt;</xsl:text>
@@ -136,7 +136,7 @@
Jahren), in Schulklassen, Bibliotheken und bei anderen Anlässen. Wenn du
Interesse an einer Lesung des Autors oder in anderen verfügbaren Sprachen
durch Ehrenamtliche der FSFE hast, dann kontaktiere uns unter
<email mailto="yes">contact@fsfe.org</email>.</p>
<email mailto="yes" subject="Ada and Zangemann">contact@fsfe.org</email>.</p>
<figure>
<img
@@ -148,7 +148,7 @@
book: At events for children and adults (from 6 to 106 years), in school
classes, libraries and on other occasions. If you are are interested in a
reading by the author or in other available languages by FSFE volunteers,
please contact us at <email mailto="yes">contact@fsfe.org</email>.</p>
please contact us at <email mailto="yes" subject="Ada and Zangemann">contact@fsfe.org</email>.</p>
<figure>
<img
@@ -133,7 +133,7 @@
<h2>Lecturas del libro</h2>
<p>Matthias Kirschner, el autor, ya ha realizado varias lecturas del libro: en eventos para niños y adultos (de 6 a 106 años), en colegios, en bibliotecas y otras ocasiones. Si está interesado en una lectura por el autor o por voluntarios de la FSFE en otros idiomas, póngase en contacto con nosotros en <email mailto="yes">contact@fsfe.org</email>.</p>
<p>Matthias Kirschner, el autor, ya ha realizado varias lecturas del libro: en eventos para niños y adultos (de 6 a 106 años), en colegios, en bibliotecas y otras ocasiones. Si está interesado en una lectura por el autor o por voluntarios de la FSFE en otros idiomas, póngase en contacto con nosotros en <email mailto="yes" subject="Ada and Zangemann">contact@fsfe.org</email>.</p>
<figure>
<img
@@ -113,7 +113,7 @@ Direttrice esecutiva, Free Software Foundation</em></p>
<h2>Letture del libro</h2>
<p>L'autore Matthias Kirschner ha già dato diverse letture del libro: in eventi per bambini e adulti (dai 6 ai 106 anni), per classi scolastiche, in biblioteche e in altre occasioni. Se ti interessa una lettura da parte dell'autore o nelle altre lingue disponibili da parte dei volontari della FSFE, contattaci a <email mailto="yes">contact@fsfe.org</email>.</p>
<p>L'autore Matthias Kirschner ha già dato diverse letture del libro: in eventi per bambini e adulti (dai 6 ai 106 anni), per classi scolastiche, in biblioteche e in altre occasioni. Se ti interessa una lettura da parte dell'autore o nelle altre lingue disponibili da parte dei volontari della FSFE, contattaci a <email mailto="yes" subject="Ada and Zangemann">contact@fsfe.org</email>.</p>
<figure>
<img
@@ -116,7 +116,7 @@
<h2>Leituras do livro</h2>
<p>O autor Matthias Kirschner já fez várias leituras do livro: Em eventos para crianças e adultos (dos 6 aos 106 anos), em escolas, bibliotecas e noutras ocasiões. Se estiver interessado numa leitura pelo autor ou noutras línguas disponíveis por voluntários da FSFE, por favor contacte-nos em <email mailto="yes">contact@fsfe.org</email>.</p>
<p>O autor Matthias Kirschner já fez várias leituras do livro: Em eventos para crianças e adultos (dos 6 aos 106 anos), em escolas, bibliotecas e noutras ocasiões. Se estiver interessado numa leitura pelo autor ou noutras línguas disponíveis por voluntários da FSFE, por favor contacte-nos em <email mailto="yes" subject="Ada and Zangemann">contact@fsfe.org</email>.</p>
<figure>
<img
+5 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<html>
<version>1</version>
<version>2</version>
<head>
<title>Overview of website features</title>
@@ -190,6 +190,10 @@
opened with the mail as recipient (like <email
mailto="yes">donotmailme@fsfe.org</email>), make it <code>&lt;email
mailto="yes"&gt;donotmailme@fsfe.org&lt;/email&gt;</code>.
We can also specify a subject, that most email clients will automatically set as the email subject. EG
<email mailto="yes" subject="Web development">donotmailme@fsfe.org</email> and the code to produce it:
<code>&lt;email mailto="yes" subject="Web development"&gt;donotmailme@fsfe.org&lt;/email&gt;</code>
</p>