Moar HTML5 semantic tags

This commit is contained in:
~lucidiot 2023-09-10 17:49:55 +02:00
parent 1330f7fc01
commit 4a59598671
2 changed files with 55 additions and 19 deletions

View File

@ -845,9 +845,9 @@
<p>I could go and ask for some enhancements to error reporting on all feed readers, but that would be extremely exhausting, as most work in open-source projects feels to me&mdash;I definitely am not great at communication. Instead, here is a small initiative that RSS feed developers can make to make the internals of their RSS feed generation system more visible and, for a user that is curious enough to be reading the feed's source, point directly to where they can complain at.</p>
<p>One of the approved <abbr title="RDF Site Summary">RSS</abbr> 1.0 modules, <a href="https://web.resource.org/rss/1.0/modules/admin/" target="_blank"><code>mod_admin</code></a>, also called the Administrative Module, defines an XML namespace, <code>xmlns:admin="http://webns.net/mvcb/"</code>, and two extra tags you can use:</p>
<dl>
<dt><code>&lt;admin:generatorAgent&gt;</code></dt>
<dt><code>&lt;<dfn>admin:generatorAgent</dfn>&gt;</code></dt>
<dd>Should use an URI in a <code>rdf:resource</code> attribute to point to the feed generator. This is redundant with the <abbr title="Really Simple Syndication">RSS</abbr> 2.0 <a href="https://www.rssboard.org/rss-profile#element-channel-generator" target="_blank"><code>&lt;generator&gt;</code></a> tag, and the <a href="https://validator.w3.org/feed/" target="_blank">W3C Feed Validation Service</a> will complain if you use both tags at once, but with this new tag, you can specify a URI instead of some arbitrary string, which could let a feed reader make a link available more easily.</dd>
<dt><code>&lt;admin:errorReportsTo&gt;</code></dt>
<dt><code>&lt;<dfn>admin:errorReportsTo</dfn>&gt;</code></dt>
<dd>As above, the <code>rdf:resource</code> attribute should point to somewhere to report issues with this feed. This is usually a <code>mailto:</code> URI, but you could also point it to a contact form over HTTP. This is similar to the <a href="https://www.rssboard.org/rss-profile#element-channel-webmaster" target="_blank"><code>&lt;webMaster&gt;</code></a> tag, but the W3C validator does not complain about a redundancy here, so you can safely use both.</dd>
</dl>
<p>By adding <code>&lt;admin:generatorAgent&gt;</code> to your feed, you could let some random developer, let's say, <em>me</em>, look at your RSS feed generation code, and maybe find the bug for you. By adding <code>&lt;admin:errorReportsTo&gt;</code>, a tag name that is more explicit than <code>webMaster</code>, with a clickable <code>mailto:</code> link or a link to a contact form, you can make it easier for curious users and random developers to tell you that something is wrong.</p>

View File

@ -80,8 +80,10 @@
<img src="{image/url/text()}" alt="{image/title/text()}" title="{image/description/text()}" />
</a>
</xsl:if>
<h1><xsl:value-of select="title" /></h1>
<p><xsl:value-of select="description" /></p>
<hgroup>
<h1><xsl:value-of select="title" /></h1>
<p><xsl:value-of select="description" /></p>
</hgroup>
</header>
<!-- TODO: include Dublin Core stuff -->
@ -188,22 +190,50 @@
</dd>
</xsl:if>
<!--
HTML5 only allows one <address> tag to note the contact information
for a <main> or <article>, so we use errorReportsTo which is always
an email address, or when not available we fallback on webMaster,
and finally on managingEditor.
-->
<xsl:if test="managingEditor">
<dt>Managing editor</dt>
<dd><xsl:value-of select="managingEditor" /></dd>
<dd>
<xsl:choose>
<xsl:when test="webMaster or admin:errorReportsTo">
<xsl:value-of select="managingEditor" />
</xsl:when>
<xsl:otherwise>
<address>
<xsl:value-of select="managingEditor" />
</address>
</xsl:otherwise>
</xsl:choose>
</dd>
</xsl:if>
<xsl:if test="webMaster">
<dt>Webmaster</dt>
<dd><xsl:value-of select="webMaster" /></dd>
<xsl:choose>
<xsl:when test="admin:errorReportsTo">
<xsl:value-of select="webMaster" />
</xsl:when>
<xsl:otherwise>
<address>
<xsl:value-of select="webMaster" />
</address>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="admin:errorReportsTo">
<dt>Error reports</dt>
<dd>
<a href="{admin:errorReportsTo/@rdf:resource}" target="_blank">
<xsl:value-of select="admin:errorReportsTo/@rdf:resource" />
</a>
<address>
<a href="{admin:errorReportsTo/@rdf:resource}" target="_blank">
<xsl:value-of select="admin:errorReportsTo/@rdf:resource" />
</a>
</address>
</dd>
</xsl:if>
@ -471,15 +501,19 @@
<xsl:if test="title or link or pubDate">
<header>
<xsl:if test="title">
<h2><xsl:value-of select="title" /></h2>
</xsl:if>
<xsl:if test="link">
<p>
<a href="{link}" target="_blank">
<xsl:value-of select="link" />
</a>
</p>
<xsl:if test="title or link">
<hgroup>
<xsl:if test="title">
<h2><xsl:value-of select="title" /></h2>
</xsl:if>
<xsl:if test="link">
<p>
<a href="{link}" target="_blank">
<xsl:value-of select="link" />
</a>
</p>
</xsl:if>
</hgroup>
</xsl:if>
<xsl:if test="pubDate">
<p>
@ -545,7 +579,9 @@
<xsl:if test="author">
<span class="icon-author" alt="Author" />
<xsl:value-of select="author" />
<address>
<xsl:value-of select="author" />
</address>
</xsl:if>
<xsl:if test="source">