Blasta/stylesheet/stylesheet.xsl

523 lines
30 KiB
XML
Raw Normal View History

<?xml version='1.0' encoding='UTF-8' ?>
<xsl:stylesheet version='1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
xmlns:xml='http://www.w3.org/XML/1998/namespace'
xmlns:media='http://search.yahoo.com/mrss/'
xmlns:georss='http://www.georss.org/georss'
xmlns:geo='http://www.w3.org/2003/01/geo/wgs84_pos#'
xmlns:atom10='http://www.w3.org/2005/Atom'
xmlns:atom='http://www.w3.org/2005/Atom'>
<xsl:output
method = 'html'
indent = 'yes' />
<!-- set page metadata -->
<xsl:template name='metadata'>
<xsl:param name='name'/>
<xsl:param name='content'/>
<xsl:if test='$content and not($content="")'>
<xsl:element name='meta'>
<xsl:attribute name='name'>
<xsl:value-of select='$name'/>
</xsl:attribute>
<xsl:attribute name='content'>
<xsl:value-of select='$content'/>
</xsl:attribute>
</xsl:element>
</xsl:if>
</xsl:template>
<xsl:template match='/atom:feed'>
<!-- index right-to-left language codes -->
<!-- TODO http://www.w3.org/TR/xpath/#function-lang -->
<xsl:variable name='rtl'
select='@xml:lang[
contains(self::node(),"ar") or
contains(self::node(),"fa") or
contains(self::node(),"he") or
contains(self::node(),"ji") or
contains(self::node(),"ku") or
contains(self::node(),"ur") or
contains(self::node(),"yi")]'/>
<html>
<head>
<xsl:call-template name='metadata'>
<xsl:with-param name='name' select='"description"' />
<xsl:with-param name='content' select='atom:subtitle' />
</xsl:call-template>
<xsl:call-template name='metadata'>
<xsl:with-param name='name' select='"generator"' />
<xsl:with-param name='content' select='"Blasta"' />
</xsl:call-template>
<xsl:call-template name='metadata'>
<xsl:with-param name='name' select='"mimetype"' />
<xsl:with-param name='content' select='"application/atom+xml"' />
</xsl:call-template>
<title>
<xsl:value-of select='atom:title'/>
</title>
<link rel='stylesheet' type='text/css' media='screen' href='/stylesheet/stylesheet.css'/>
<link rel='icon' type='image/svg+xml' href='/graphic/blasta.svg'/>
</head>
<body>
<div id='header'>
<!-- feed title -->
<h1>
<img src='/graphic/blasta_syndicate.svg'/>
&#160;
<xsl:value-of select='atom:title'/>
</h1>
<dl id='navigation'>
<dd>
<img src='/graphic/blasta_syndicate.svg'/>
</dd>
<dd>
<xsl:element name='a'>
<xsl:attribute name='href'>
<xsl:value-of select='atom:link[@rel="alternate" and @type="text/html"]/@href'/>
</xsl:attribute>
<xsl:attribute name='title'>Return to Blasta.</xsl:attribute>
Return
</xsl:element>
</dd>
<dd>
<xsl:element name='a'>
<xsl:attribute name='href'>
<xsl:value-of select='atom:link[@rel="self"]/@href'/>
</xsl:attribute>
<xsl:attribute name='download'>blasta_atom_syndication_feed.atom</xsl:attribute>
<xsl:attribute name='id'>follow</xsl:attribute>
<xsl:attribute name='title'>Subscribe to updates with a news reader software.</xsl:attribute>
Follow
</xsl:element>
</dd>
<dd>
<a id='subtome' title='Subscribe via SubToMe.'>
<xsl:attribute name='href'>
javascript:location.href='https://www.subtome.com/#/subscribe?feeds='+location.href;
</xsl:attribute>
<xsl:attribute name='onclick'>
(
function(btn){
var z=document.createElement('script');
document.subtomeBtn=btn;
z.src='https://www.subtome.com/load.js';document.body.appendChild(z);
}
)(this);
return false;
</xsl:attribute>
SubToMe
</a>
</dd>
<dd>
<xsl:element name='a'>
<xsl:attribute name='href'>
<xsl:value-of select='atom:link[@rel="alternate" and @type="x-scheme-handler/xmpp"]/@href'/>
</xsl:attribute>
<xsl:attribute name='id'>subscribe</xsl:attribute>
<xsl:attribute name='title'>Subscribe to updates with an XMPP software.</xsl:attribute>
Subscribe
</xsl:element>
</dd>
<dd>
<a href='/help/about/xmpp'
title='Of the benefits of XMPP.'>
XMPP
</a>
</dd>
<dd>
<a href='https://xmpp.link/#syndication@conference.movim.eu?join'
title='Syndictaion and PubSub.'>
Groupchat
</a>
</dd>
<dd>
<a href='/help/feeds'
title='Of the benefits of syndication feed.'
id='aboutfeeds'>
Help
</a>
</dd>
</dl>
</div>
<xsl:if test='count(atom:entry) &gt; 1'>
<div>
<h2>
<xsl:element name='a'>
<xsl:attribute name='href'>
<xsl:value-of select='atom:link[@rel="self"]/@href'/>
</xsl:attribute>
<xsl:attribute name='download'>blasta_atom_syndication_feed.atom</xsl:attribute>
<xsl:attribute name='id'>follow</xsl:attribute>
<xsl:attribute name='title'>Subscribe to updates with a news reader software.</xsl:attribute>
<img alt='logo' src='/graphic/syndicate.svg' height='18' width='18'/>
</xsl:element>
&#160;
<xsl:value-of select='atom:subtitle'/>
</h2>
<p>
» Syndicating 10 bookmarks.
</p>
<h3>
Blasta Syndication Feed
</h3>
<!-- xsl:for-each select='atom:entry[position() &lt;21]' -->
<ul>
<xsl:for-each select='atom:entry[not(position() &gt; 20)]'>
<li>
<xsl:element name='a'>
<xsl:attribute name='href'>
<xsl:text>#blasta-</xsl:text>
<xsl:value-of select='position()'/>
</xsl:attribute>
<xsl:choose>
<xsl:when test='string-length(atom:title) &gt; 0'>
<xsl:value-of select='atom:title'/>
</xsl:when>
<xsl:otherwise>
*** No Title ***
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</li>
</xsl:for-each>
</ul>
</div>
</xsl:if>
<div id='main'>
<!-- feed entry -->
<dl>
<dd>
<article class='title'>
<h4 class='title'>
<a href='/help/feeds'>
This is an automated Blasta Syndication Feed
</a>
</h4>
<h5 class='related'>
<img alt='💡'
height='16'
src='/graphic/xmpp.svg'
width='16' />
&#160;
<a href='/help/about/xmpp/pubsub'>/help/about/xmpp/pubsub</a>
&#160;
<img alt='⚛'
class='enlarge'
height='16'
src='/graphic/syndicate.svg'
width='16' />
&#160;
<a href='/help/syndication'>/help/syndication</a>
</h5>
<p>
<b>Congratulations!</b> You have reached to the final
frontier that the XML technology has to offer
to-date, and as of yet!
</p>
<p>
This is an automated Blasta Syndication Feed
which you can utilize to gracefully receive
autmatic Blasta updates.
</p>
<p>
<a href='/help/syndication#software'>Click
here</a> for a selection of software and pick
the ones that would fit to you best!
</p>
<div class='details'>
<a href='?mode=feed&amp;tags=filetype:atom'>filetype:atom </a>
<a href='?mode=feed&amp;tags=filetype:rss'>filetype:rss </a>
<a href='?mode=feed&amp;tags=filetype:xml'>filetype:xml </a>
<a href='?mode=feed&amp;tags=software:akregator'>software:akregator </a>
<a href='?mode=feed&amp;tags=software:fraidycat'>software:fraidycat </a>
<a href='?mode=feed&amp;tags=software:liferea'>software:liferea </a>
<a href='?mode=feed&amp;tags=software:otter-browser'>software:otter-browser </a>
<a href='?mode=feed&amp;tags=software:raven-reader'>software:raven-reader </a>
<a href='?mode=feed&amp;tags=niche:syndication'>niche:syndication</a>
<h5 class='updated'>2024-08-22T17:09:04+03:00</h5>
<h5 class='author'>
<a href='/jid/sch@pimux.de'>sch@pimux.de</a>
</h5>
</div>
</article>
</dd>
<xsl:choose>
<xsl:when test='atom:entry'>
<xsl:for-each select='atom:entry[not(position() >20)]'>
<dd>
<article class='title'>
<!-- entry title -->
<h4 class='title'>
<xsl:element name='a'>
<xsl:attribute name='href'>
<xsl:choose>
<xsl:when test='atom:link[@rel="self"]'>
<xsl:value-of select='atom:link[@rel="self"]/@href'/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select='atom:link/@href'/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name='id'>
<xsl:text>blasta-</xsl:text>
<xsl:value-of select='position()'/>
</xsl:attribute>
<xsl:choose>
<xsl:when test='string-length(atom:title) &gt; 0'>
<xsl:value-of select='atom:title'/>
</xsl:when>
<xsl:otherwise>
*** No Title ***
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</h4>
<h5 class='related'>
💡️
<xsl:element name='a'>
<xsl:attribute name='href'>
<xsl:value-of select='atom:link[@rel="alternate" and @type="x-scheme-handler/xmpp"]/@href'/>
</xsl:attribute>
PubSub
</xsl:element>
&#160;
💬
<xsl:element name='a'>
<xsl:attribute name='href'>
<xsl:value-of select='atom:link[@rel="related" and @type="text/html"]/@href'/>
</xsl:attribute>
Folksonomy
</xsl:element>
</h5>
<!-- entry content -->
<p class='summary'>
<xsl:value-of select='atom:summary'/>
</p>
<!-- entry tags -->
<xsl:if test='atom:category/@term'>
<div class='details'>
<xsl:for-each select='atom:category'>
<xsl:element name='a'>
<xsl:attribute name='href'>
?mode=feed&amp;tags=<xsl:value-of select='@term'/>
</xsl:attribute>
<xsl:value-of select='@term'/>
</xsl:element>
&#160;
</xsl:for-each>
<h5 class='date'>
<!-- entry date -->
<xsl:choose>
<xsl:when test='atom:updated'>
<xsl:attribute name='class'>
<xsl:text>updated</xsl:text>
</xsl:attribute>
<xsl:value-of select='atom:updated'/>
</xsl:when>
<xsl:when test='atom:published'>
<xsl:attribute name='class'>
<xsl:text>published</xsl:text>
</xsl:attribute>
<xsl:value-of select='atom:published'/>
</xsl:when>
<xsl:otherwise>
<h4 class='warning atom1 published'></h4>
</xsl:otherwise>
</xsl:choose>
</h5>
<!-- entry author -->
<h5 class='author'>
<xsl:choose>
<xsl:when test='atom:author/atom:email'>
<xsl:element name='a'>
<xsl:attribute name='href'>
<xsl:text>mailto:</xsl:text>
<xsl:value-of select='atom:author/atom:email'/>
</xsl:attribute>
<xsl:attribute name='title'>
<xsl:text>Send an Email to </xsl:text>
<xsl:value-of select='atom:author/atom:email'/>
</xsl:attribute>
<xsl:value-of select='atom:author/atom:name'/>
</xsl:element>
</xsl:when>
<xsl:when test='atom:author/atom:uri'>
<xsl:element name='a'>
<xsl:attribute name='href'>
<xsl:value-of select='atom:author/atom:uri'/>
</xsl:attribute>
<xsl:attribute name='title'>
<xsl:value-of select='atom:author/atom:summary'/>
</xsl:attribute>
<xsl:value-of select='atom:author/atom:name'/>
</xsl:element>
</xsl:when>
<xsl:when test='atom:author/atom:name'>
<xsl:text>By </xsl:text>
<xsl:value-of select='atom:author/atom:name'/>
</xsl:when>
</xsl:choose>
</h5>
</div>
</xsl:if>
</article>
<!-- entry id -->
<xsl:if test='not(atom:id)'>
<div class='warning atom1 id'>No entry ID</div>
</xsl:if>
</dd>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<dd>
<div class='entry'>
<h3 class='title'>
<a href='javascript:alert("Please check that the mother PubSub node is populated with content.")'>
No content
</a>
</h3>
<h4>This entry is empty</h4>
<div class='content'>Please check that the mother PubSub node is populated with content.</div>
</div>
</dd>
</xsl:otherwise>
</xsl:choose>
<dd>
<article class='title'>
<h4 class='title'>
<a href='/help/feeds'>
About Blasta Feeds
</a>
</h4>
<h5 class='related'>
<img alt='💡'
height='16'
src='/graphic/xmpp.svg'
width='16' />
&#160;
<a href='/help/about/xmpp/pubsub'>About XMPP</a>
&#160;
<img alt='⚛'
class='enlarge'
height='16'
src='/graphic/syndicate.svg'
width='16' />
&#160;
<a href='/help/syndication'>About Syndication</a>
</h5>
<p>
This is a concise introduction to the syndication
technology. <b>Please, read it.</b>
</p>
<p>
This an Atom document which can also be viewed
with a Syndication Feed Reader (also referred to
as News Reader or RSS Reader) which provides
automated news updates and notifications on
desktop and mobile.
<a href='/help/syndication#software'>Click
here</a> for a selection of software and pick
the ones that would fit to you best!
</p>
<p>
This ASF (Atom Syndication Format) document is
conveyed as an XHTML document. This document was
produced by an XSLT <a
href='stylesheet/stylesheet.xsl'>stylesheet</a>.
</p>
<p>
XSLT is a powerful technology which transforms
XML documents into HTML, JSON, PDF, Text, XHTML,
and (modified) XML documents;
<a href='https://www.w3.org/Style/XSL/'>Learn
more</a> about The Extensible Stylesheet
Language Family (XSL).
</p>
<div class='details'>
<a href='?mode=feed&amp;tags=brand:atompub'>brand:atompub </a>
<a href='?mode=feed&amp;tags=brand:atomsub'>brand:atomsub </a>
<a href='?mode=feed&amp;tags=brand:pubsub'>brand:pubsub </a>
<a href='?mode=feed&amp;tags=code:xslt'>code:xslt </a>
<a href='?mode=feed&amp;tags=filetype:atom'>filetype:atom </a>
<a href='?mode=feed&amp;tags=filetype:rss'>filetype:rss </a>
<a href='?mode=feed&amp;tags=filetype:xml'>filetype:xml </a>
<a href='?mode=feed&amp;tags=software:libervia'>software:libervia </a>
<a href='?mode=feed&amp;tags=software:movim'>software:movim </a>
<a href='?mode=feed&amp;tags=software:reeder'>software:reeder </a>
<a href='?mode=feed&amp;tags=niche:syndication'>niche:syndication</a>
<h5 class='updated'>2024-08-22T17:09:04+03:00</h5>
<h5 class='author'>
<a href='/jid/sch@pimux.de'>sch@pimux.de</a>
</h5>
</div>
</article>
</dd>
</dl>
</div>
<div id='footer'>
<dl>
<dd>
<img src='/graphic/blasta.svg' alt='logo'/>
<a href='/'>
Blasta
</a>
</dd>
<dd>
<a href='https://joinjabber.org'
title='An Inclusive Space On The Jabber Network.'>
JoinJabber
</a>
</dd>
<dd>
<a href='https://libervia.org'
title='The Universal Communication Ecosystem.'>
Libervia
</a>
</dd>
<dd>
<a href='https://join.movim.eu'
title='The Social Platform Shaped For Your Community.'>
Movim
</a>
</dd>
<dd>
<a href='https://git.xmpp-it.net/sch/Rivista'
title='A Journal Publisher And Browser For XMPP.'>
Rivista
</a>
</dd>
<dd>
<a href='https://github.com/SeveFP/Reeder'
title='An XMPP-Based Feed Reader.'>
Reeder
</a>
</dd>
<dd>
<a href='https://modernxmpp.org'
title='A Project To Improve The Quality Of User-To-User Messaging Applications That Use XMPP.'>
Modern
</a>
</dd>
<dd>
<a href='https://xmpp.org'
title='The Universal Messaging Standard.'>
XMPP
</a>
</dd>
<dd>
<a href='https://xmpp.org/extensions/xep-0060.html'
title='XEP-0060: Publish-Subscribe.'>
PubSub
</a>
</dd>
</dl>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>