News in verschiedenen Dateien weiter, news-rss.xml kaputt...

git-svn-id: svn://svn.c3d2.de/c3d2-web/branches/toidinamais_coole_scheisse@69 31f61c52-7bfb-0310-b897-fc00f8a278f0
This commit is contained in:
toidinamai 2005-12-28 18:04:17 +00:00
parent 52c8f9e6e2
commit 6c4b49cf4c
3 changed files with 42 additions and 33 deletions

View File

@ -16,12 +16,14 @@ STYLE_RSS=xsl/rss.xsl
NAVIGATION=content/navigation.xml
# XML-Skeletons
SKELETONS:=$(wildcard content/skel-*.xml)
SKEL=empty
SKEL:=empty
# Zu verwendendes Skeleton
SKELFILE=content/skel-$(SKEL).xml
# Dateinamen der Inhalte:
CONTENT:=$(patsubst content/%.xml, www/%.html, $(filter-out $(NAVIGATION) $(SKELETONS), $(wildcard content/*.xml)))
CLEAN:=$(CONTENT) www/news-rss.xml chaosupdates.rdf
CONTENT=$(PAGES) www/news.html #www/news-rss.xml
PAGES:=$(patsubst content/%.xml, www/%.html, $(filter-out $(NAVIGATION) $(SKELETONS), $(wildcard content/*.xml)))
NEWSITEMS:=$(wildcard content/news/*.xml)
CLEAN:=$(CONTENT) www/news.html www/news-rss.xml chaosupdates.rdf
### Defaults ###
.PHONY: contents clean
@ -30,10 +32,17 @@ CLEAN:=$(CONTENT) www/news-rss.xml chaosupdates.rdf
contents: $(CONTENT)
#www/news-rss.xml
### Regeln für den XSLT-Prozess ###
www/news.html: $(NEWSITEMS) $(STYLE) $(NAVIGATION)
{ echo '<?xml version="1.0" encoding="UTF-8"?>' ; \
echo "<page>"; \
echo " <news>"; \
for item in $^ ; do \
echo " <newsfile>$${item}</newsfile>"; \
done; \
echo " </news>"; \
echo "</page>"; } | $(PROCESSOR) -o $@ $(STYLE) -
www/%.html: content/%.xml $(STYLE) $(NAVIGATION) chaosupdates.rdf
$(PROCESSOR) -o $@ $(STYLE) $<

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<navigation>
<file>news</file>
<file>kontakt</file>
<file>mailingliste</file>
<file>wiki</file>

View File

@ -196,34 +196,35 @@
</xsl:element>
</xsl:template>
<xsl:template match="item">
<h3 class="news"><xsl:value-of select="@title"/></h3>
<small class="news_author">
<xsl:value-of select="@author"/>
</small>
<xsl:variable name="datestring">
<xsl:call-template name="get-datestring">
<xsl:with-param name="seconds" select="@date" />
</xsl:call-template>
</xsl:variable>
<xsl:element name="small">
<xsl:attribute name="class">news_date</xsl:attribute>
<xsl:value-of select="concat('@', $datestring)"/>
</xsl:element>
<div class="news">
<xsl:apply-templates/>
</div>
<hr class="news"/>
</xsl:template>
<xsl:template match="news">
<xsl:for-each select="item">
<h3 class="news"><xsl:value-of select="@title"/></h3>
<small class="news_author">
<xsl:value-of select="@author"/>
</small>
<xsl:for-each select="newsfile">
<xsl:apply-templates select="document(current())/item" />
<xsl:variable name="datestring">
<xsl:call-template name="get-datestring">
<xsl:with-param name="seconds" select="@date" />
</xsl:call-template>
</xsl:variable>
<xsl:message>
<xsl:text>Date: (</xsl:text><xsl:value-of select="$datestring" /><xsl:text>)</xsl:text>
</xsl:message>
<xsl:element name="small">
<xsl:attribute name="class">news_date</xsl:attribute>
<!--
<xsl:attribute name="title"><xsl:value-of select="@date"/></xsl:attribute>
-->
@ <xsl:value-of select="$datestring"/>
</xsl:element>
<div class="news">
<xsl:apply-templates/>
</div>
<hr class="news"/>
</xsl:for-each>
</xsl:template>