3 Parameter für xhtml.xsl:

- pagetitle um Seitentitel aus der Makefile zu überschreiben
- newsbodies ('off', damit nur Newsüberschriften angezeigt werden)
- newscategory um News optional nach Kategorie zu filtern
Hauptnewsseite hat jetzt unten Links zu ATOM, RSS & Archiv
Hauptnewsseite hat nur noch 10 News
Makefile-Rules für dynamische Seiten (themenabende, news-archiv)
nichtexistierende pages können jetzt auch in die navigation.xml, falls ein title angegeben ist
themenabende in die navigation
news/rwx.xml nach news/ta-rwx.html umbenannt
xsl:element- und xsl:attribute-reduktion


git-svn-id: svn://svn.c3d2.de/c3d2-web/trunk@452 31f61c52-7bfb-0310-b897-fc00f8a278f0
This commit is contained in:
astro 2006-07-25 21:24:59 +00:00
parent 7975bb6f2b
commit cbcc857358
5 changed files with 83 additions and 40 deletions

View File

@ -36,7 +36,7 @@ WWW_CCC_DE_UPDATES=chaosupdates.rdf
### Ziele ###
# Dateinamen der zu erzeugenden html-Dateien:
CONTENT=$(PAGES) $(NEWS_PAGES) $(DS_PAGES) $(NEWSFILES) $(SEARCH_TMPL)
CONTENT=$(PAGES) $(NEWS_PAGES) $(DS_PAGES) $(NEWSFILES) $(SEARCH_TMPL) $(DYNAMIC)
# 'normale' Seiten:
PAGES:=$(patsubst content/pages/%.xml, build/%.html, $(wildcard content/pages/*.xml))
@ -48,6 +48,8 @@ NEWSFILES:=build/news.html build/news-rss.xml build/news-atom.xml
DS_PAGES:=$(patsubst content/datenspuren/%.xml, build/datenspuren/%.html, $(wildcard content/datenspuren/*.xml)) build/datenspuren/schedule.html
# Suchseiten-Template
SEARCH_TMPL:=build/cgi-bin/search.html
# Dynamische Seiten:
DYNAMIC:=build/themenabende.html build/news-archiv.html
# Quellen
NEWSITEMS:=$(wildcard content/news/*.xml)
@ -86,13 +88,25 @@ news.xml: $(NEWSITEMS)
$(NEWSFILES): news.xml $(NAVIGATION) $(STYLE)
$(call xml_process)
# Pages:
build/%.html: content/pages/%.xml $(STYLE) $(NAVIGATION) $(WWW_CCC_DE_UPDATES)
$(call xml_process)
# News:
build/news/%.html : BASEURL="../"
build/news/%.html: content/news/%.xml $(STYLE) $(NAVIGATION) $(WWW_CCC_DE_UPDATES)
$(call xml_process)
# Dynamisches:
build/news-archiv.html : PFLAGS+=--stringparam pagetitle News-Archiv --stringparam newsbodies off
build/news-archiv.html: news.xml $(NAVIGATION) $(STYLE)
$(call xml_process)
build/themenabende.html : PFLAGS+=--stringparam pagetitle Themenabende --stringparam newsbodies off --stringparam newscategory Themenabend
build/themenabende.html: news.xml $(NAVIGATION) $(STYLE)
$(call xml_process)
# Suche:
build/cgi-bin/search.html : BASEURL="../"
build/cgi-bin/search.html: content/cgi-bin/search.xml $(STYLE) $(NAVIGATION)
$(call xml_process)

View File

@ -1,10 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<navigation>
<file title='News'>news</file>
<file>whois</file>
<file>kontakt</file>
<file>mailingliste</file>
<file>treff</file>
<file title='Themenabende'>themenabende</file>
<file>projekte</file>
<file>wiki</file>
<file>silc</file>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE item SYSTEM "http://www.c3d2.de/dtd/c3d2web.dtd">
<?xml-stylesheet type="text/xsl" href="../../xsl/html.xsl" ?>
<item title="Themenabend: Beyond rwxr-x---" date="2006-06-14T23:05:50" author="Alien8" category="TA">
<item title="Themenabend: Beyond rwxr-x---" date="2006-06-14T23:05:50" author="Alien8" category="Themenabend">
<image title="rwx">rwx.png</image>
<p>
Was es so alles außer <em>chmod a+s *</em> auf aktuellen Betriebssystemen gibt, um Zugriffsrechte zu kontrollieren, füllt am 22.6.2006 eine Nacht. Das Programm ist congresswürdig.

View File

@ -95,25 +95,31 @@
<xsl:template name="navitem">
<xsl:param name="file"/>
<xsl:param name="baseurl"/>
<xsl:param name="title"/>
<li>
<xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of select="concat($baseurl, $file, '.html')"/></xsl:attribute>
<xsl:if test="document(concat('../content/pages/', $file, '.xml'))/page/@pagetitle">
<xsl:attribute name="title"><xsl:value-of select="document(concat('../content/pages/', $file, '.xml'))/page/@pagetitle"/></xsl:attribute>
</xsl:if>
<xsl:value-of select="document(concat('../content/pages/', $file, '.xml'))/page/@title"/>
</xsl:element>
<a href="{$baseurl}{$file}.html">
<xsl:choose>
<xsl:when test="string-length($title) = 0">
<xsl:if test="document(concat('../content/pages/', $file, '.xml'))/page/@pagetitle">
<xsl:attribute name="title"><xsl:value-of select="document(concat('../content/pages/', $file, '.xml'))/page/@pagetitle"/></xsl:attribute>
</xsl:if>
<xsl:value-of select="document(concat('../content/pages/', $file, '.xml'))/page/@title"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$title"/>
</xsl:otherwise>
</xsl:choose>
</a>
</li>
</xsl:template>
<xsl:template name="navitems">
<ul>
<li>
<a href="{$baseurl}news.html" title="News">News</a>
</li>
<xsl:for-each select="document('../content/navigation.xml')/navigation/file">
<xsl:call-template name="navitem">
<xsl:with-param name="file" select="."/>
<xsl:with-param name="title" select="@title"/>
<xsl:with-param name="baseurl" select="$baseurl"/>
</xsl:call-template>
</xsl:for-each>

View File

@ -7,6 +7,11 @@
exclude-result-prefixes="xsl rss rdf">
<xsl:param name="newsbodies"/>
<xsl:param name="newscategory"/>
<xsl:param name="pagetitle"/>
<xsl:include href="common.xsl" />
<xsl:include href="date.xsl" />
<xsl:include href="header.xsl" />
@ -22,6 +27,9 @@
<xsl:template match="/page">
<xsl:variable name="title">
<xsl:choose>
<xsl:when test="$pagetitle != ''">
<xsl:value-of select="$pagetitle"/>
</xsl:when>
<xsl:when test="/page/@pagetitle">
<xsl:value-of select="/page/@pagetitle"/>
</xsl:when>
@ -174,44 +182,57 @@
<xsl:template match="/page/news">
<xsl:for-each select="newsfile">
<xsl:sort select="date:seconds(document(concat('../', .))/item/@date)" data-type="number" order="descending" />
<xsl:if test="position() &lt;= 15">
<xsl:if test="(position() &lt;= 10) or ($newsbodies = 'off')">
<xsl:variable name="newsfile"><xsl:value-of select="."/></xsl:variable>
<xsl:variable name="itemposition" select="position()"/>
<xsl:for-each select="document(concat('../', $newsfile))/item">
<h3 class="news">
<a href="{substring-before(substring-after($newsfile, 'content/'), '.xml')}.html">
<xsl:value-of select="@title"/>
</a>
</h3>
<xsl:call-template name="news-meta"/>
<div class="news">
<xsl:apply-templates>
<xsl:with-param name="itemposition" select="$itemposition"/>
</xsl:apply-templates>
<xsl:call-template name="include-resources">
<xsl:with-param name="include-hidden">no</xsl:with-param>
</xsl:call-template>
<xsl:if test="//addendum">
<p>
<a href="{substring-before(substring-after($newsfile, 'content/'), '.xml')}.html">
Weiterlesen...
</a>
</p>
<xsl:if test="($newscategory = '') or ($newscategory = @category)">
<h3 class="news">
<a href="{substring-before(substring-after($newsfile, 'content/'), '.xml')}.html">
<xsl:value-of select="@title"/>
</a>
</h3>
<xsl:call-template name="news-meta"/>
<xsl:if test="$newsbodies != 'off'">
<div class="news">
<xsl:apply-templates>
<xsl:with-param name="itemposition" select="$itemposition"/>
</xsl:apply-templates>
<xsl:call-template name="include-resources">
<xsl:with-param name="include-hidden">no</xsl:with-param>
</xsl:call-template>
<xsl:if test="//addendum">
<p>
<a href="{substring-before(substring-after($newsfile, 'content/'), '.xml')}.html">
Weiterlesen...
</a>
</p>
</xsl:if>
</div>
<hr class="news"/>
</xsl:if>
</div>
<hr class="news"/>
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:for-each>
<xsl:if test="$newsbodies != 'off'">
<p>
Die Neuigkeiten des C3D2 sind auch als <a href="{$baseurl}news-atom.xml">ATOM</a> und <a href="{$baseurl}news-rss.xml">RSS</a> abrufbar.
Mehr News gibts im <a href="{$baseurl}news-archiv.html">Archiv</a>.
</p>
</xsl:if>
</xsl:template>
<xsl:template name="news-meta">