From fb463e95e8a428af03cdbdca5f8e2fb8d7e7b35f Mon Sep 17 00:00:00 2001 From: Martin Byrenheid Date: Wed, 29 Jan 2014 20:34:33 +0100 Subject: [PATCH] Worked on news redesign --- Makefile | 53 ++++++++- content/c3d2/news/overview.xml | 12 +- content/c3d2/pages/schule.xml | 2 - content/c3d2/pages/unterstuetzen.xml | 2 - .../{page2html => news2page}/include/date.xsl | 0 transformation/news2page/item.xsl | 61 ++++++++++ transformation/news2page/news.xsl | 109 +++++++++++++----- transformation/page2html/include/entities.xsl | 61 ---------- transformation/page2html/page2html.xsl | 17 ++- 9 files changed, 209 insertions(+), 108 deletions(-) rename transformation/{page2html => news2page}/include/date.xsl (100%) diff --git a/Makefile b/Makefile index 477678865..912f0b5c4 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,6 @@ PROCESSOR=xsltproc PFLAGS=--novalid - # The root directory of every transformation # used in the following makefile TRANSFORMATION_ROOT=transformation @@ -11,11 +10,48 @@ TRANSFORMATION_ROOT=transformation HTML_OUTPUT=output/html PAGE_OUTPUT=output/page +NEWS_OUTPUT=output/news + +# +# C3D2-specific configuration +# +TITLE_PREFIX="C3D2 Blub" +BASEURL="" + +# +# Predefined functions +# + +# news2page (target, pathinclude) where +# "target" - the path of the xml file to be transformed +# "pathinclude" - additional paths (separated by whitespace) for inclusion of news items +news2page = $(PROCESSOR) $(PFLAGS) --path "$(NEWS_OUTPUT) $(2)" $(TRANSFORMATION_ROOT)/news2page/news.xsl $(1) + +# page2html (target, pathincluce) where +# "target" - the path of the xml file to be transformed +# "pathinclude" - additional paths (separated by whitespace) for inclusion of news items +page2html = $(PROCESSOR) $(PFLAGS) --path "$(PAGE_OUTPUT) $(TRANSFORMATION_ROOT)/page2html $(2)" --stringparam baseurl $(BASEURL) --stringparam common_title_prefix $(TITLE_PREFIX) $(TRANSFORMATION_ROOT)/page2html/page2html.xsl $(1) + +all: prepare_output $(HTML_OUTPUT)/news.html $(HTML_OUTPUT)/unterstuetzen.html $(HTML_OUTPUT)/schule.html + +prepare_output: + mkdir -p $(HTML_OUTPUT) $(PAGE_OUTPUT) $(NEWS_OUTPUT) + cp -rf content/c3d2/static/* $(HTML_OUTPUT) + +# +# Static pages +# + +$(HTML_OUTPUT)/schule.html: + $(call page2html, content/c3d2/pages/schule.xml , content/c3d2 content/c3d2/pages) > $(HTML_OUTPUT)/schule.html + +$(HTML_OUTPUT)/unterstuetzen.html: + $(call page2html, content/c3d2/pages/unterstuetzen.xml , content/c3d2 content/c3d2/pages) > $(HTML_OUTPUT)/unterstuetzen.html + # # NEWS # -NEWS_OUTPUT=output/news ITEMS_DIR=content/c3d2/items @@ -27,10 +63,17 @@ LIST_GENERATOR=scripts/generate-news-list.sh # 1. Generate a list of all news items # stored within $(ITEMS_DIR). -$(NEWS_OUTPUT)/news-list.xml: +$(NEWS_OUTPUT)/news-list.xml: $(LIST_GENERATOR) $(ITEMS_DIR) > $(NEWS_OUTPUT)/news-list.xml # 2. Transform the news.xml-file into a page # TODO: Replace PROCESSOR-call with a predefined procedure for news2page-transformation. -$(PAGE_OUTPUT)/news.xml: - $(PROCESSOR) $(TRANSFORMATION_ROOT)/news2page/news.xsl content/c3d2/news/overview.xml +$(PAGE_OUTPUT)/news.xml: $(NEWS_OUTPUT)/news-list.xml + $(call news2page, content/c3d2/news/overview.xml, content/c3d2/items) > $(PAGE_OUTPUT)/news.xml + +# 3. Transform the news page into HTML +$(HTML_OUTPUT)/news.html: $(PAGE_OUTPUT)/news.xml + $(call page2html, output/page/news.xml , $(PAGE_OUTPUT) content/c3d2 content/c3d2/pages) > $(HTML_OUTPUT)/news.html + +clean: + rm -rf $(NEWS_OUTPUT)/* $(PAGE_OUTPUT)/* $(HTML_OUTPUT)/* diff --git a/content/c3d2/news/overview.xml b/content/c3d2/news/overview.xml index f0bee6a94..fa76dfe19 100644 --- a/content/c3d2/news/overview.xml +++ b/content/c3d2/news/overview.xml @@ -1,16 +1,16 @@ - - + + diff --git a/content/c3d2/pages/schule.xml b/content/c3d2/pages/schule.xml index 19fab2fc6..798369ed0 100644 --- a/content/c3d2/pages/schule.xml +++ b/content/c3d2/pages/schule.xml @@ -1,6 +1,4 @@ - -

diff --git a/content/c3d2/pages/unterstuetzen.xml b/content/c3d2/pages/unterstuetzen.xml index c54e6ef55..1478b7697 100644 --- a/content/c3d2/pages/unterstuetzen.xml +++ b/content/c3d2/pages/unterstuetzen.xml @@ -1,6 +1,4 @@ - -

diff --git a/transformation/page2html/include/date.xsl b/transformation/news2page/include/date.xsl similarity index 100% rename from transformation/page2html/include/date.xsl rename to transformation/news2page/include/date.xsl diff --git a/transformation/news2page/item.xsl b/transformation/news2page/item.xsl index cfee27a2c..20de1eb6a 100644 --- a/transformation/news2page/item.xsl +++ b/transformation/news2page/item.xsl @@ -6,6 +6,67 @@ xmlns:crypto="http://exslt.org/crypto" exclude-result-prefixes="xsl date crypto"> + + + +

+ +
+ + + + + + +
Datum
+
+ + + + + + + + + + + + + + bis + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
Ort
+
+
+ diff --git a/transformation/news2page/news.xsl b/transformation/news2page/news.xsl index 44f2b608d..4255fca18 100644 --- a/transformation/news2page/news.xsl +++ b/transformation/news2page/news.xsl @@ -1,43 +1,78 @@ - - - + - - - + - - + + + + + + + + + + + + + + + + + + @ + + + + + + + + + + + + + + + + + + + +
- - vevent - -

- +

- - - + + - + - +
  • @@ -59,24 +94,27 @@
-
- -
+
- + + + + + - - - + + + + - +
@@ -85,12 +123,12 @@

- +

- +
@@ -100,7 +138,7 @@ @@ -116,5 +154,16 @@ + + + + + + diff --git a/transformation/page2html/include/entities.xsl b/transformation/page2html/include/entities.xsl index 05068280c..3cc4b8a66 100644 --- a/transformation/page2html/include/entities.xsl +++ b/transformation/page2html/include/entities.xsl @@ -210,67 +210,6 @@ - - - -
- -
-
- - - - - -
Datum
-
- - - - - - - - - - - - - - bis - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - -
Ort
-
-
- diff --git a/transformation/page2html/page2html.xsl b/transformation/page2html/page2html.xsl index dd552e7c6..76743f1d9 100644 --- a/transformation/page2html/page2html.xsl +++ b/transformation/page2html/page2html.xsl @@ -1,12 +1,12 @@ + @@ -93,7 +93,7 @@
- + @@ -155,4 +155,17 @@ + + + + + + + +