Add RSS 2.0 feed of the GNOME news flashes with full item
descriptions, not just titles and links, for better usability with feed aggregators.
This commit is contained in:
parent
86e8306178
commit
a2f0c4fbb0
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/www/; revision=31242
2 changed files with 84 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
# $FreeBSD: www/en/gnome/Makefile,v 1.25 2006/08/19 21:20:34 hrs Exp $
|
||||
# $FreeBSD: www/en/gnome/Makefile,v 1.26 2006/10/12 21:21:05 mezz Exp $
|
||||
|
||||
.if exists(../Makefile.conf)
|
||||
.include "../Makefile.conf"
|
||||
|
@ -23,5 +23,6 @@ XSLTPROCOPTS.index= ${XSLTPROCOPTS:N--nonet}
|
|||
|
||||
XMLDOCS+= newsflash
|
||||
XMLDOCS+= news:rss.xsl::news.rdf
|
||||
XMLDOCS+= newsrss:rss2.xsl::rss.xml
|
||||
|
||||
.include "${WEB_PREFIX}/share/mk/web.site.mk"
|
||||
|
|
82
en/gnome/rss2.xsl
Normal file
82
en/gnome/rss2.xsl
Normal file
|
@ -0,0 +1,82 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
||||
<!DOCTYPE xsl:stylesheet PUBLIC "-//FreeBSD//DTD FreeBSD XSLT 1.0 DTD//EN"
|
||||
"http://www.FreeBSD.org/XML/www/share/sgml/xslt10-freebsd.dtd" [
|
||||
<!ENTITY base "..">
|
||||
<!ENTITY title "FreeBSD GNOME Project News System">
|
||||
]>
|
||||
|
||||
<!-- $FreeBSD$ -->
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
|
||||
xmlns:cvs="http://www.FreeBSD.org/XML/CVS"
|
||||
exclude-result-prefixes="cvs">
|
||||
|
||||
<xsl:import href="http://www.FreeBSD.org/XML/www/lang/share/sgml/libcommon.xsl"/>
|
||||
|
||||
<xsl:output method="xml" indent="yes"/>
|
||||
|
||||
|
||||
<xsl:variable name="date">
|
||||
<xsl:value-of select="//cvs:keyword[@name='freebsd']"/>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:template match="/">
|
||||
<xsl:variable name="title">FreeBSD GNOME Project News</xsl:variable>
|
||||
<xsl:variable name="link">http://www.FreeBSD.org/gnome/</xsl:variable>
|
||||
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
|
||||
<title><xsl:value-of select="$title" /></title>
|
||||
<link><xsl:value-of select="$link" /></link>
|
||||
<description>FreeBSD GNOME News System</description>
|
||||
<language>en-us</language>
|
||||
<webMaster>freebsd-gnome@FreeBSD.org (FreeBSD GNOME Team)</webMaster>
|
||||
<managingEditor>freebsd-gnome@FreeBSD.org (FreeBSD GNOME Team)</managingEditor>
|
||||
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
|
||||
<ttl>120</ttl>
|
||||
<image>
|
||||
<url>http://www.FreeBSD.org/logo/logo-full.png</url>
|
||||
<title><xsl:value-of select="$title" /></title>
|
||||
<link><xsl:value-of select="$link" /></link>
|
||||
</image>
|
||||
<atom:link rel="self" type="application/rss+xml">
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="$link" /><xsl:text>rss.xml</xsl:text>
|
||||
</xsl:attribute>
|
||||
</atom:link>
|
||||
|
||||
<xsl:for-each select="descendant::event[position() <= 10]">
|
||||
<xsl:variable name="guid"><xsl:call-template name="generate-event-anchor"/></xsl:variable>
|
||||
|
||||
<item>
|
||||
<title>
|
||||
<xsl:choose>
|
||||
<xsl:when test="count(child::title)">
|
||||
<xsl:value-of select="title"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:copy-of select="p"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</title>
|
||||
<xsl:if test="count(child::title)">
|
||||
<description>
|
||||
<xsl:apply-templates select="p"/>
|
||||
</description>
|
||||
</xsl:if>
|
||||
|
||||
<link>http://www.FreeBSD.org/gnome/newsflash#<xsl:value-of select="$guid" /></link>
|
||||
<guid>http://www.FreeBSD.org/gnome/newsflash#<xsl:value-of select="$guid" /></guid>
|
||||
</item>
|
||||
</xsl:for-each>
|
||||
|
||||
</channel>
|
||||
</rss>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="a">
|
||||
<xsl:value-of select="@href" />
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
Loading…
Reference in a new issue