added feed support for multiple formats; Pentacast OGG feed as an example; more todo

This commit is contained in:
payload 2012-10-15 23:18:24 +02:00
parent 3a654f4495
commit 0bd0c6c1f2
5 changed files with 26 additions and 23 deletions

View File

@ -64,7 +64,8 @@ NEWSFILES:=build/news.html build/news-rss.xml build/news-atom.xml \
build/podcast-archiv.xml build/pentaradio-archiv.xml build/pentacast-archiv.xml \
build/pentamusic-archiv.xml build/pentamedia-archiv.xml \
build/ical.ics build/xcal.xml build/reminders \
build/datenspuren/$(DS_YEAR)/news-rss.xml build/datenspuren/$(DS_YEAR)/news-atom.xml
build/datenspuren/$(DS_YEAR)/news-rss.xml build/datenspuren/$(DS_YEAR)/news-atom.xml \
build/pentacast-ogg.xml build/pentacast-ogg-archiv.xml
PLAYLISTS:=$(patsubst content/news/pentaradio%.xml, build/news/pentaradio%.xspf, $(wildcard content/news/pentaradio*.xml)) \
$(patsubst content/news/pentaradio%.xml, build/news/pentaradio%.pls, $(wildcard content/news/pentaradio*.xml)) \
$(patsubst content/news/pentaradio%.xml, build/news/pentaradio%.m3u, $(wildcard content/news/pentaradio*.xml))
@ -130,8 +131,14 @@ build/pentaradio.xml build/pentaradio-archiv.xml : PFLAGS+=--stringparam selecti
build/pentaradio.xml build/pentaradio-archiv.xml: xsl/podcast.xsl # Does not work with $(STYLE) - why?
build/pentacast.xml build/pentacast-archiv.xml : STYLE=xsl/podcast.xsl
build/pentacast.xml build/pentacast-archiv.xml : VFLAGS_OUT=$(VFLAGS) --schema xsd/rss20.xsd
build/pentacast.xml build/pentacast-archiv.xml : PFLAGS+=--stringparam selection pentacast
build/pentacast.xml build/pentacast-archiv.xml : PFLAGS+=--stringparam selection pentacast --stringparam format audio/mpeg
build/pentacast.xml build/pentacast-archiv.xml: xsl/podcast.xsl # Does not work with $(STYLE) - why?
build/pentacast-ogg.xml build/pentacast-ogg-archiv.xml : STYLE=xsl/podcast.xsl
build/pentacast-ogg.xml build/pentacast-ogg-archiv.xml : VFLAGS_OUT=$(VFLAGS) --schema xsd/rss20.xsd
build/pentacast-ogg.xml build/pentacast-ogg-archiv.xml : PFLAGS+=--stringparam selection pentacast --stringparam format audio/ogg
build/pentacast-ogg.xml build/pentacast-ogg-archiv.xml : xsl/podcast.xsl # Does not work with $(STYLE) - why?
build/pentamusic.xml build/pentamusic-archiv.xml : STYLE=xsl/podcast.xsl
build/pentamusic.xml build/pentamusic-archiv.xml : VFLAGS_OUT=$(VFLAGS) --schema xsd/rss20.xsd
build/pentamusic.xml build/pentamusic-archiv.xml : PFLAGS+=--stringparam selection pentamusic
@ -228,3 +235,4 @@ $(WWW_CCC_DE_UPDATES): $(WWW_CCC_DE_UPDATES).orig
.PHONY: clean
clean:
$(RM) $(CLEAN) news.xml

View File

@ -5,18 +5,13 @@
<page title="Pentacast" pagetitle="(((c3d2))) Pentacast">
<p>
Pentacast ist ein unregelmäßig erscheinender Podcast mit
Konzentration auf ein Thema. Wir freuen uns über <link
href="http://pentamedia.org/pentacast">Feedback</link>.
Konzentration auf ein Thema. Wir freuen uns über
<link href="http://pentamedia.org/pentacast">Feedback</link>.
</p>
<p>
<image title="(((pentacast))" class="right">images/pentacast.png</image>
Die Feeds der C3D2-News (<link href="news-rss.xml">RSS</link>, <link href="news-atom.xml">ATOM</link>) beinhalten die Mitschnitte als Podcasts.
Daneben gibt es noch
<link href="podcast.xml">Podcast-</link>
und <link href="pentacast.xml">Pentacast-Feeds</link>, die je
nach Verfügbarkeit die MP3-Versionen enthalten.
<link href="warez.html">Feeds</link>
<link class="flattr" href="https://flattr.com/thing/51037/Pentacast">Flattr this!</link>
</p>

View File

@ -27,6 +27,9 @@
<link href="news-rss.xml">RSS</link> (<link href="news-archiv-rss.xml">Archiv-Feed</link>)
</dd>
<dt>OGG-Feeds</dt>
<dd><link href="pentacast-ogg.xml">Pentacast</link> (<link href="pentacast-ogg-archiv.xml">Archiv-Feed</link>)</dd>
<dt>MP3-Feeds</dt>
<dd><link href="podcast.xml">Alle Podcasts</link> (<link href="podcast-archiv.xml">Archiv-Feed</link>)</dd>
<dd><link href="pentaradio.xml">Pentaradio</link> (<link href="pentaradio-archiv.xml">Archiv-Feed</link>)</dd>

View File

@ -596,7 +596,7 @@ a[href$="news-atom.xml"]:before {
}
a[href$="podcast.xml"]:before, a[href$="pentaradio.xml"]:before,
a[href$="pentacast.xml"]:before, a[href$="pentamusic.xml"]:before,
a[href$="pentamedia.xml"]:before {
a[href$="pentamedia.xml"]:before, a[href="pentacast-ogg.xml"]:before {
content: url(../images/mime/feed.png);
padding-right: 0.3em;
}
@ -767,4 +767,4 @@ a.flattr:hover {
article,aside,details,figcaption,figure,
footer,header,hgroup,menu,nav,section {
display: block;
}
}

View File

@ -21,6 +21,7 @@
<xsl:variable name="baseurl">http://www.c3d2.de/</xsl:variable>
<xsl:param name="selection" select="''"/>
<xsl:param name="format"/>
<xsl:template match="news">
<rss version="2.0">
@ -179,8 +180,9 @@
</rss>
</xsl:template>
<!-- Preselect heißt:
* Gucken, ob es in der Resource nicht ein Alternative gibt, welches MP3 ist
* Gucken, ob es in der Resource nicht ein Alternative gibt, welches $format ist
* Dann dieses nehmen
* Ansonsten die Resource nehmen
-->
@ -188,19 +190,13 @@
<xsl:param name="newsfile"/>
<xsl:choose>
<!-- Gibts ein MP3? -->
<xsl:when test="count(alternative[@type='audio/mpeg']) &gt; 0">
<xsl:apply-templates test="alternative[@type='audio/mpeg'][1]">
<!-- Gibts ein $format? -->
<xsl:when test="count(alternative[@type=$format]) &gt; 0">
<xsl:apply-templates test="alternative[@type=$format][1]">
<xsl:with-param name="newsfile" select="$newsfile"/>
</xsl:apply-templates>
</xsl:when>
<!-- Gibts ein MP4? -->
<xsl:when test="count(alternative[@type='video/mp4']) &gt; 0">
<xsl:apply-templates test="alternative[@type='video/mp4'][1]">
<xsl:with-param name="newsfile" select="$newsfile"/>
</xsl:apply-templates>
</xsl:when>
<!-- Nimm was da ist (OGG) -->
<!-- Nimm was da ist -->
<xsl:otherwise>
<xsl:apply-templates select=".">
<xsl:with-param name="newsfile" select="$newsfile"/>
@ -209,6 +205,7 @@
</xsl:choose>
</xsl:template>
<xsl:template match="*[name() = 'resource' or name() = 'alternative']">
<xsl:param name="newsfile"/>