rss style und ds1

master
vv01f 2 years ago
parent cf21e3ef2d
commit 19fc6ab5c2
No known key found for this signature in database
GPG Key ID: 02625A16AC1D1FF6
  1. 9
      data.xml
  2. 5
      gen.sh
  3. 98
      rss.xsl
  4. 47
      style-rss.css

@ -487,7 +487,7 @@ Zudem gibt es einen neuen Redaktions-PGP-Key, erhältlich auf allen Keyservern o
<!--date>???, ?? Sep 1988 00:00 UT</date-->
</schleuder>
<schleuder id="25">
<image>covers/ds25.jpg</image>
<image>covers/ds025.jpg</image>
<link>/pdfs/ds025.pdf</link>
<filesize>7984192</filesize>
<!--date>???, ?? Mar 1988 00:00 UT</date-->
@ -617,8 +617,9 @@ Zudem gibt es einen neuen Redaktions-PGP-Key, erhältlich auf allen Keyservern o
<!--date>???, ?? Apr 1984 00:00 UT</date-->
</schleuder>
<schleuder id="1">
<image>covers/ds1.jpg</image>
<link>/alteszeug.html</link>
<!--date></date-->
<image>covers/ds001.jpg</image>
<link>/pdfs/ds001.pdf</link>
<filesize>486824</filesize>
<!--date>1984</date-->
</schleuder>
</schleudern>

@ -34,10 +34,11 @@ assert_source () {
}
build () {
datafn="$1"
dependencies="xsltproc"
dependencies="xsltproc date"
assert_tools ${dependencies}
>&2 printf "building ds-feed.xml … "
xsltproc --encoding utf-8 -o ds-feed.xml rss.xsl $datafn && { >&2 printf "done.\n"; } || { >&2 printf "failed on rss.xsl.\n"; exit 1; }
# --stringparam current-date `date +%Y-%m-%d` # possibility for current date-time-group via XSLT <xsl:value-of select="$current-date"/>
xsltproc --stringparam current-date "$(date --rfc-email)" --encoding utf-8 -o ds-feed.xml rss.xsl $datafn && { >&2 printf "done.\n"; } || { >&2 printf "failed on rss.xsl.\n"; exit 1; }
>&2 printf "building download.html … "
xsltproc --encoding iso-8859-1 -o download.html download.xsl $datafn && { >&2 printf "done.\n"; } || { >&2 printf "failed on download.xsl.\n"; exit 1; }
>&2 printf "building index.html … "

@ -1,39 +1,57 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" encoding="UTF-8" version="1.0">
<!--
xmlns:exsltstr="http://exslt.org/strings"
-->
<xsl:stylesheet encoding="UTF-8" version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<!-- xmlns:exsltstr="http://exslt.org/strings" -->
<!-- xmlns:date="http://exslt.org/dates-and-times" extension-element-prefixes="date" -->
<xsl:output omit-xml-declaration="yes"/>
<!--xsl:output method="xml" indent="yes" encoding="utf-8"/-->
<!--xmlns:dc="http://purl.org/dc/elements/1.1/"-->
<xsl:template match="/schleudern">
<!--DOCTYPE rss-->
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<xsl:text disable-output-escaping="yes">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</xsl:text><xsl:text>&#10;</xsl:text>
<xsl:text disable-output-escaping="yes">&lt;?xml-stylesheet type="text/css" href="https://ds.ccc.de/style-rss.css"?&gt;</xsl:text><xsl:text>&#10;</xsl:text>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><xsl:text>&#10;</xsl:text>
<xsl:text>&#10;</xsl:text>
<channel><xsl:text>&#10;&#9;</xsl:text>
<xsl:variable name="limitenclosures">0</xsl:variable><!-- 0:no limit, 1:limit is one -->
<xsl:variable name="protocol">https://</xsl:variable>
<xsl:variable name="baseurl">ds.ccc.de</xsl:variable>
<xsl:variable name="feedfile">/ds-feed.xml</xsl:variable>
<title>Datenschleuder</title>
<xsl:text>&#10;&#9;</xsl:text>
<xsl:element name="atom:link">
<xsl:attribute name="rel">self</xsl:attribute>
<xsl:attribute name="rel">self</xsl:attribute><!-- when atom url is rss url -->
<xsl:attribute name="href"><xsl:value-of select="concat($protocol,$baseurl,$feedfile)"/></xsl:attribute>
<xsl:attribute name="type">application/rss+xml</xsl:attribute>
</xsl:element>
<xsl:text>&#10;&#9;</xsl:text>
<!--
<atom:link href="https://ds.ccc.de/ds-feed.xml" rel="self" type="application/rss+xml" />
-->
<title>Datenschleuder</title>
<xsl:element name="link"><xsl:value-of select="concat($protocol,$baseurl,'/')"/></xsl:element><!-- <link>https://ds.ccc.de</link> -->
<description>Das wissenschaftliche Fachblatt für Datenreisende; ein Organ des Chaos Computer Club.</description>
<language>de</language>
<!--copyright></copyright-->
<managingEditor>ds@ccc.de (Redaktion)</managingEditor>
<!--lastBuildDate></lastBuildDate-->
<ttl>65535</ttl>
<image>
<xsl:element name="url"><xsl:value-of select="concat($protocol,$baseurl,'/i/ds_headline.gif')"/></xsl:element><!-- <url>https://ds.ccc.de</url> -->
<title>Datenschleuder</title>
<xsl:element name="link"><xsl:value-of select="concat($protocol,$baseurl,'/')"/></xsl:element>
</image>
<xsl:element name="link"><xsl:value-of select="concat($protocol,$baseurl,'/')"/></xsl:element><!-- <link>https://ds.ccc.de</link> -->
<xsl:text>&#10;&#9;</xsl:text>
<description>Das wissenschaftliche Fachblatt für Datenreisende; ein Organ des Chaos Computer Club.</description>
<xsl:text>&#10;&#9;</xsl:text>
<lastBuildDate><xsl:value-of select="$current-date"/></lastBuildDate>
<xsl:text>&#10;&#9;</xsl:text>
<!-- lastBuildDate>Tue, 30 Mar 2021 10:27:18 +0000</lastBuildDate-->
<!-- <xsl:value-of select="date:date-time()"/> -->
<!-- # \-\-stringparam current-date `date +%Y-%m-%d` # possibility for current date-time-group via XSLT <xsl:value-of select="$current-date"/> -->
<language>de</language>
<xsl:text>&#10;&#9;</xsl:text>
<!--copyright></copyright-->
<managingEditor>ds@ccc.de (Redaktion)</managingEditor>
<xsl:text>&#10;&#9;</xsl:text>
<!--webMaster>ds@ccc.de</webMaster-->
<ttl>65535</ttl>
<xsl:text>&#10;&#9;</xsl:text>
<image>
<xsl:element name="url"><xsl:value-of select="concat($protocol,$baseurl,'/i/ds_headline.gif')"/></xsl:element><!-- <url>https://ds.ccc.de</url> -->
<title>Datenschleuder</title>
<xsl:element name="link"><xsl:value-of select="concat($protocol,$baseurl,'/')"/></xsl:element>
</image>
<xsl:text>&#10;&#9;</xsl:text>
<!--
<item>
@ -53,15 +71,23 @@ xmlns:exsltstr="http://exslt.org/strings"
<xsl:for-each select="catalog/cd">
-->
<xsl:element name="item">
<xsl:text>&#10;&#9;</xsl:text>
<!-- we do not have most optional elements -->
<xsl:element name="title"><xsl:value-of select="concat('Datenschleuder #',@id)"/></xsl:element>
<xsl:text>&#10;&#9;</xsl:text>
<xsl:choose>
<xsl:when test="not(date)"></xsl:when>
<xsl:otherwise><xsl:element name="pubDate"><xsl:value-of select="date"/></xsl:element><xsl:text>&#10;&#9;</xsl:text></xsl:otherwise>
</xsl:choose>
<xsl:element name="description">
<xsl:text disable-output-escaping="yes">&lt;![CDATA[ </xsl:text>
<xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text>
<xsl:value-of select="concat('Ausgabe #',@id,' ')"/>
<xsl:if test="string-length(preface) &gt; 0">
<xsl:element name="a"><xsl:attribute name="href"><xsl:value-of select="concat($protocol,$baseurl,preface)"/></xsl:attribute>Geleitwort</xsl:element>
<xsl:text>&#10;&#9;</xsl:text>
</xsl:if>
<xsl:if test="string-length(image) &gt; 0">
@ -69,22 +95,20 @@ xmlns:exsltstr="http://exslt.org/strings"
<xsl:element name="img"><xsl:attribute name="src">
<xsl:value-of select="concat($protocol,$baseurl,'/',image)"/></xsl:attribute>
</xsl:element>
<xsl:text>&#10;&#9;</xsl:text>
</xsl:if>
<xsl:for-each select="link">
<xsl:for-each select="link">
<xsl:if test="((position() &gt; 1) and ($limitenclosures = 1))">
<xsl:text disable-output-escaping="yes"> </xsl:text>
<xsl:element name="a"><xsl:attribute name="href"><xsl:value-of select="concat($protocol,$baseurl,.)"/></xsl:attribute><xsl:value-of select="concat('Anhang ',position())"/></xsl:element>
<xsl:text>&#10;&#9;</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text disable-output-escaping="yes"> ]]&gt;</xsl:text>
<xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>
</xsl:element>
<xsl:choose>
<xsl:when test="not(date)"></xsl:when>
<xsl:otherwise><xsl:element name="pubDate"><xsl:value-of select="date"/></xsl:element></xsl:otherwise>
</xsl:choose>
<xsl:text>&#10;&#9;</xsl:text>
<xsl:variable name="id">
<xsl:value-of select="@id"/>
@ -94,7 +118,7 @@ xmlns:exsltstr="http://exslt.org/strings"
<xsl:variable name="position">
<xsl:value-of select="position()"/>
</xsl:variable>
</xsl:variable>
<xsl:variable name="href">
<xsl:value-of select="concat($protocol,$baseurl,.)"/>
@ -106,10 +130,10 @@ xmlns:exsltstr="http://exslt.org/strings"
<xsl:value-of select="@filesize"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="../filesize"/>
<xsl:value-of select="../filesize"/><!-- todo: if not available lenth="0" -->
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
</xsl:variable>
<xsl:variable name="type">
<xsl:choose>
@ -125,7 +149,7 @@ xmlns:exsltstr="http://exslt.org/strings"
<xsl:element name="guid">
<xsl:attribute name="isPermaLink">true</xsl:attribute>
<xsl:value-of select="$href"/>
</xsl:element>
</xsl:element>
</xsl:if>
<xsl:if test="$type = 'html'">
<xsl:element name="guid">
@ -135,7 +159,7 @@ xmlns:exsltstr="http://exslt.org/strings"
</xsl:if>
<xsl:element name="link">
<xsl:value-of select="$href"/>
</xsl:element>
</xsl:element>
</xsl:if>
<xsl:if test="((($position &gt; 1) and ($limitenclosures = 0)) or ($position = 1))">
@ -146,7 +170,7 @@ xmlns:exsltstr="http://exslt.org/strings"
<xsl:attribute name="url"><xsl:value-of select="$href"/></xsl:attribute>
<xsl:attribute name="length"><xsl:value-of select="$filesize"/></xsl:attribute>
<xsl:attribute name="type">application/pdf</xsl:attribute>
</xsl:element>
</xsl:element>
</xsl:when>
<xsl:when test="$type = 'epub'">
@ -174,7 +198,7 @@ xmlns:exsltstr="http://exslt.org/strings"
<xsl:value-of select="concat($protocol,$baseurl,'/#',exsltstr:encode-uri(@id, 'true', 'UTF-8'))"/>
-->
<xsl:value-of select="concat($protocol,$baseurl,'/#',@id)"/>
</xsl:element>
</xsl:element>
</xsl:if>
</xsl:element>
</xsl:for-each>

@ -0,0 +1,47 @@
rss {
display: block;
font-family: verdana, arial;
}
channel title {
display: block;
margin: 5px;
padding: 2px;
color: gray;
border-bottom: 1px solid silver;
font-size: 2em;
}
link {
display: block;
font-size: small;
padding-left: 10px;
}
item {
display: block;
padding: 2px 30px 2px 30px;
}
docs {
display: block;
background-color: #ffffe6;
margin: 20px;
text-align: center;
padding: 5px;
color: #7f7f7f;
border: 1px solid silver;
}
description {
display: block;
font-size: 1.2em;
}
pubDate:before {
content:"Veröffentlicht: ";
}
managingEditor:before{
content:"E-Mail: ";
}
lastBuildDate:before{
content:"Letzte Aktualisierung: ";
}
/* all hidden elements */
channel link, channel image, image title, language, ttl, guid, category {
display: none;
}
Loading…
Cancel
Save