- Add news/news.xml dependency to index.html.

- Add several templates for index.xsl into includes.misc.xsl.

- The structure of mirrors.xml has been changed; <host> is
  a container of <name> and <url> now.
This commit is contained in:
Hiroki Sato 2003-12-06 07:39:32 +00:00
parent d1ee31674f
commit 52aee72dda
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/www/; revision=19064
3 changed files with 138 additions and 66 deletions

View file

@ -1,4 +1,4 @@
# $FreeBSD: www/en/Makefile,v 1.103 2003/12/05 19:58:36 blackend Exp $
# $FreeBSD: www/en/Makefile,v 1.104 2003/12/05 20:00:19 blackend Exp $
.if exists(Makefile.conf)
.include "Makefile.conf"
.endif
@ -104,12 +104,14 @@ webcheck:
.include "${WEB_PREFIX}/share/mk/web.site.mk"
index.html: index.xsl ${XML_INCLUDES}\
${XML_NEWS_INCLUDES} ${XML_NEWS_NEWS}\
${XML_NEWS_INCLUDES} ${XML_NEWS_NEWS} ${XML_NEWS_PRESS}\
${XML_MIRRORS} ${XML_ADVISORIES}
${XSLTPROC} ${XSLTPROCOPTS} \
-o $@ \
--param mirrors.xml "'${XML_MIRRORS}'" \
--param advisories.xml "'${XML_ADVISORIES}'" \
--param news.press.xml "'${XML_NEWS_PRESS}'" \
--param news.project.xml "'${XML_NEWS_NEWS}'" \
${.CURDIR}/index.xsl ${XML_NEWS_NEWS}
.if !defined(NO_TIDY)
-${TIDY} ${TIDYOPTS} ${.TARGET}

View file

@ -1,4 +1,4 @@
<!-- $FreeBSD: www/en/index.xsl,v 1.83 2003/11/24 18:26:33 hrs Exp $ -->
<!-- $FreeBSD: www/en/index.xsl,v 1.84 2003/12/02 20:12:28 trhodes Exp $ -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
@ -6,9 +6,16 @@
<xsl:import href="news/includes.xsl"/>
<xsl:variable name="base" select="'.'"/>
<xsl:variable name="date" select="'$FreeBSD: www/en/index.xsl,v 1.83 2003/11/24 18:26:33 hrs Exp $'"/>
<xsl:variable name="date" select="'$FreeBSD: www/en/index.xsl,v 1.84 2003/12/02 20:12:28 trhodes Exp $'"/>
<xsl:variable name="title" select="'The FreeBSD Project'"/>
<!-- these params should be externally bound. The values
here are not used actually -->
<xsl:param name="advisories.xml" select="'none'"/>
<xsl:param name="mirrors.xml" select="'none'"/>
<xsl:param name="news.press.xml" select="'none'"/>
<xsl:param name="news.project.xml" select="'none'"/>
<xsl:output type="html" encoding="iso-8859-1"
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
@ -347,31 +354,16 @@
<p><font size="+1" color="#990000"><b>Project News</b></font><br/>
<font size="-1">
Latest update:
<xsl:value-of
select="descendant::month[position() = 1]/name"/>
<xsl:text> </xsl:text>
<xsl:value-of
select="descendant::day[position() = 1]/name"/>,
<xsl:text> </xsl:text>
<xsl:value-of
select="descendant::year[position() = 1]/name"/>
<xsl:call-template name="html-index-news-project-items-lastmodified">
<xsl:with-param name="news.project.xml" select="$news.project.xml" />
</xsl:call-template>
<br/>
<!-- Pull in the 10 most recent news items -->
<xsl:for-each select="descendant::event[position() &lt;= 10]">
&#183; <a>
<xsl:attribute name="href">
news/newsflash.html#<xsl:call-template name="generate-event-anchor"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="count(child::title)">
<xsl:value-of select="title"/><br/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="p"/><br/>
</xsl:otherwise>
</xsl:choose>
</a>
</xsl:for-each>
<xsl:call-template name="html-index-news-project-items">
<xsl:with-param name="news.project.xml" select="$news.project.xml" />
</xsl:call-template>
<a href="news/newsflash.html">More...</a>
</font></p>
@ -379,21 +371,16 @@
<font size="-1">
Latest update:
<xsl:value-of
select="document('news/press.xml')/descendant::month[position() = 1]/name"/>
<xsl:text> </xsl:text>
<xsl:value-of
select="document('news/press.xml')/descendant::year[position() = 1]/name"/>
<xsl:call-template name="html-index-news-press-items-lastmodified">
<xsl:with-param name="news.press.xml" select="$news.press.xml" />
</xsl:call-template>
<br/>
<!-- Pull in the 10 most recent press items -->
<xsl:for-each select="document('news/press.xml')/descendant::story[position() &lt; 10]">
&#183; <a>
<xsl:attribute name="href">
news/press.html#<xsl:call-template name="generate-story-anchor"/>
</xsl:attribute>
<xsl:value-of select="name"/>
</a><br/>
</xsl:for-each>
<xsl:call-template name="html-index-news-press-items">
<xsl:with-param name="news.press.xml" select="$news.press.xml" />
</xsl:call-template>
<a href="news/press.html">More...</a>
</font>
</p>
@ -402,22 +389,16 @@
<font size="-1">
Latest update:
<xsl:value-of
select="document($advisories.xml)/descendant::month[position() = 1]/name"/>
<xsl:text> </xsl:text>
<xsl:value-of
select="document($advisories.xml)/descendant::day[position() = 1]/name"/>
<xsl:text>, </xsl:text>
<xsl:value-of
select="document($advisories.xml)/descendant::year[position() = 1]/name"/>
<xsl:call-template name="html-index-advisories-items-lastmodified">
<xsl:with-param name="advisories.xml" select="$advisories.xml" />
</xsl:call-template>
<br/>
<!-- Pull in the 10 most recent security advisories -->
<xsl:for-each select="document($advisories.xml)/descendant::advisory[position() &lt; 10]">
&#183; <a>
<xsl:attribute name="href">ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/<xsl:value-of select="name"/>.asc</xsl:attribute>
<xsl:value-of select="name"/>
</a><br/>
</xsl:for-each>
<xsl:call-template name="html-index-advisories-items">
<xsl:with-param name="advisories.xml" select="$advisories.xml" />
</xsl:call-template>
<a href="security/">More...</a>
</font>
</p>

View file

@ -1,15 +1,104 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!-- $FreeBSD$ -->
<!-- $FreeBSD: www/share/sgml/includes.misc.xsl,v 1.1 2003/11/24 18:26:34 hrs Exp $ -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:param name="leadingmark" select="'&#183; '"/>
<!-- Often used trademarks -->
<xsl:variable name="unix" select="'UNIX&#174;'"/>
<xsl:variable name="java" select="'Java&#8482;'"/>
<xsl:variable name="jdk" select="'JDK&#8482;'"/>
<xsl:variable name="posix" select="'POSIX&#174;'"/>
<!-- template: "html-index-advisories-items"
pulls in the 10 most recent security advisories -->
<xsl:template name="html-index-advisories-items">
<xsl:param name="advisories.xml" select="''" />
<xsl:for-each select="document($advisories.xml)/descendant::advisory[position() &lt;= 10]">
<xsl:value-of select="$leadingmark" /><a>
<xsl:attribute name="href">ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/<xsl:value-of select="name"/>.asc</xsl:attribute>
<xsl:value-of select="name"/>
</a><br/>
</xsl:for-each>
</xsl:template>
<!-- template: "html-index-advisories-items-lastmodified" -->
<xsl:template name="html-index-advisories-items-lastmodified">
<xsl:param name="advisories.xml" select="''" />
<xsl:value-of select="document($advisories.xml)/descendant::month[position() = 1]/name"/>
<xsl:text> </xsl:text>
<xsl:value-of select="document($advisories.xml)/descendant::day[position() = 1]/name"/>
<xsl:text>, </xsl:text>
<xsl:value-of select="document($advisories.xml)/descendant::year[position() = 1]/name"/>
</xsl:template>
<!-- template: "html-index-news-project-items"
pulls in the 10 most recent project items -->
<xsl:template name="html-index-news-project-items">
<xsl:param name="news.project.xml" select="''" />
<xsl:for-each select="document($news.project.xml)/descendant::event[position() &lt;= 10]">
<xsl:value-of select="$leadingmark" /><a>
<xsl:attribute name="href">
news/newsflash.html#<xsl:call-template name="generate-event-anchor"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="count(child::title)">
<xsl:value-of select="title"/><br/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="p"/><br/>
</xsl:otherwise>
</xsl:choose>
</a>
</xsl:for-each>
</xsl:template>
<!-- template: "html-index-news-project-items-lastmodified" -->
<xsl:template name="html-index-news-project-items-lastmodified">
<xsl:param name="news.project.xml" select="''" />
<xsl:value-of select="document($news.project.xml)/descendant::month[position() = 1]/name"/>
<xsl:text> </xsl:text>
<xsl:value-of select="document($news.project.xml)/descendant::day[position() = 1]/name"/>
<xsl:text> </xsl:text>
<xsl:value-of select="document($news.project.xml)/descendant::year[position() = 1]/name"/>
</xsl:template>
<!-- template: "html-index-news-press-items"
pulls in the 10 most recent press items -->
<xsl:template name="html-index-news-press-items">
<xsl:param name="news.press.xml" select="''" />
<xsl:for-each select="document($news.press.xml)/descendant::story[position() &lt; 10]">
<xsl:value-of select="$leadingmark" /><a>
<xsl:attribute name="href">
news/press.html#<xsl:call-template name="generate-story-anchor"/>
</xsl:attribute>
<xsl:value-of select="name"/>
</a><br/>
</xsl:for-each>
</xsl:template>
<!-- template: "html-index-news-press-items-lastmodified" -->
<xsl:template name="html-index-news-press-items-lastmodified">
<xsl:param name="news.press.xml" select="''" />
<xsl:value-of select="document($news.press.xml)/descendant::month[position() = 1]/name"/>
<xsl:text> </xsl:text>
<xsl:value-of select="document($news.press.xml)/descendant::year[position() = 1]/name"/>
</xsl:template>
<!-- template: "html-index-mirrors-options-list"
generates mirror sites list in index.html -->
@ -17,17 +106,17 @@
<xsl:param name="mirrors.xml" select="''" />
<xsl:for-each select="document($mirrors.xml)/mirrors/entry[country/@role != 'primary' and
url[contains(@proto, 'httpv6') and contains(@type, 'www')]]">
host[@type = 'www']/url[@proto = 'httpv6']]">
<xsl:sort select="country" />
<xsl:for-each select="url[contains(@proto, 'httpv6') and contains(@type, 'www')]">
<xsl:for-each select="host[@type = 'www']/url[@proto = 'httpv6']">
<option><xsl:attribute name="value"><xsl:value-of select="." /></xsl:attribute>
<xsl:choose>
<xsl:when test="last() = 1">
<xsl:value-of select="concat('IPv6 ', ../country)" />
<xsl:value-of select="concat('IPv6 ', ../../country)" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('IPv6 ', ../country, '/', position())" />
<xsl:value-of select="concat('IPv6 ', ../../country, '/', position())" />
</xsl:otherwise>
</xsl:choose>
</option>
@ -35,17 +124,17 @@
</xsl:for-each>
<xsl:for-each select="document($mirrors.xml)/mirrors/entry[country/@role != 'primary' and
url[contains(@proto, 'http') and contains(@type, 'www')]]">
host[@type = 'www']/url[@proto = 'http']]">
<xsl:sort select="country" />
<xsl:for-each select="url[contains(@proto, 'http') and contains(@type, 'www')]">
<xsl:for-each select="host[@type = 'www']/url[@proto = 'http']">
<option><xsl:attribute name="value"><xsl:value-of select="." /></xsl:attribute>
<xsl:choose>
<xsl:when test="last() = 1">
<xsl:value-of select="../country" />
<xsl:value-of select="../../country" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat(../country, '/', position())" />
<xsl:value-of select="concat(../../country, '/', position())" />
</xsl:otherwise>
</xsl:choose>
</option>