- XSLTify the multimedia pages with a slightly different approach than the

earlier one.  It does not any more has per-tag and per-source pages
  but one page for tags and one for sources with anchors.  With the current
  number of entries it will probably be fine for a long time but if once
  we need to divide it into smaller chunks, it will be easier with XSLT.
- Now the documents are also rebuilt if stylesheets or the source XML
  database changes and the build time is drastically decreased.

Reviewed by:	www@
This commit is contained in:
Gabor Kovesdan 2012-09-21 10:02:57 +00:00
parent 124917ccbd
commit 2e69c9e705
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=39589
15 changed files with 5085 additions and 1997 deletions

View file

@ -0,0 +1,111 @@
<?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">
<!-- $FreeBSD$ -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:str="http://exslt.org/strings"
xmlns="http://www.w3.org/1999/xhtml"
extension-element-prefixes="str">
<xsl:import href="http://www.FreeBSD.org/XML/www/share/sgml/libcommon.xsl"/>
<xsl:template name="multimedia.pre">
<h1>FreeBSD Multimedia Resources List</h1>
<p>Links on this page refer to multimedia resources (podcast, vodcast,
audio recordings, video recordings, photos) related to FreeBSD or
of interest for FreeBSD users.</p>
<p>This list is available as <a href="multimedia.html">chronological
overview</a>, as a <a href="tags.html">tag cloud</a> and
via <a href="sources.html">the sources</a>.</p>
<p>This list is also available as RSS feed <a href="multimedia.xml"><img
src="http://www.freebsd.org/layout/images/ico_rss.png"
alt="RSS Feed"/></a></p>
<p>If you know any resources not listed here, or notice any dead links,
please send details to <a
href="mailto:edwin\@FreeBSD.org">Edwin Groothuis</a> so that
it can be included or updated.</p>
</xsl:template>
<xsl:template match="item">
<xsl:variable name="srcId" select="@source"/>
<xsl:variable name="source" select="//source[@id = $srcId]"/>
<li>
<a href="{overview}"><xsl:value-of select="title"/></a><br/>
Source:
<a>
<xsl:attribute name="href">
<xsl:value-of select="$source/url"/>
</xsl:attribute>
<xsl:value-of select="$source/name"/>
</a>
<br/>
Added:
<xsl:call-template name="misc-format-date-string">
<xsl:with-param name="year" select="substring(@added, 1, 4)"/>
<xsl:with-param name="month" select="substring(@added, 5, 2)"/>
<xsl:with-param name="day" select="substring(@added, 7, 2)"/>
</xsl:call-template>
<br/>
Tags:
<xsl:for-each select="tags/tag">
<a>
<xsl:attribute name="href">
<xsl:value-of select="concat('tags.html#', str:replace(., ' ', '_'))"/>
</xsl:attribute>
<xsl:value-of select="."/>
</a>
<xsl:if test="position() != last()">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
<br/>
<xsl:if test="files/file">
<xsl:text>Files: </xsl:text>
</xsl:if>
<xsl:for-each select="files/file">
<a href="{url}"><xsl:value-of select="desc"/></a>
<xsl:if test="size|length">
<xsl:text>&nbsp;(</xsl:text>
<xsl:for-each select="size|length">
<xsl:value-of select="."/>
<xsl:if test="position() != last()">
<xsl:text>,&nbsp;</xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:text>)</xsl:text>
</xsl:if>
<xsl:if test="position() != last()">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
<br/>
<p>
<xsl:value-of select="desc"/>
</p>
</li>
</xsl:template>
</xsl:stylesheet>