aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2014-08-18 20:44:05 +0200
committerAdrian Kummerlaender2014-08-18 20:44:05 +0200
commit99b8d15f33ac71fe85bb2fa7001d080931bba7ba (patch)
tree5111ce422e7046d223b7e14100de93f92b9c5e25
parent354edf1af29c72e4c82b904f7d219d557a0b75ec (diff)
downloadblog.kummerlaender.eu-99b8d15f33ac71fe85bb2fa7001d080931bba7ba.tar
blog.kummerlaender.eu-99b8d15f33ac71fe85bb2fa7001d080931bba7ba.tar.gz
blog.kummerlaender.eu-99b8d15f33ac71fe85bb2fa7001d080931bba7ba.tar.bz2
blog.kummerlaender.eu-99b8d15f33ac71fe85bb2fa7001d080931bba7ba.tar.lz
blog.kummerlaender.eu-99b8d15f33ac71fe85bb2fa7001d080931bba7ba.tar.xz
blog.kummerlaender.eu-99b8d15f33ac71fe85bb2fa7001d080931bba7ba.tar.zst
blog.kummerlaender.eu-99b8d15f33ac71fe85bb2fa7001d080931bba7ba.zip
Implemented basic cleaning and linking facilities
* e.g. removing the target directory before each regeneration and symlinking CSS files ** this will be extended to include ressource directories and so on * renamed "formatter.xsl" stylesheet to "helper.xsl" as it now includes various helper templates * finally checked the main CSS into the VCS
-rw-r--r--generate.xsl26
-rw-r--r--source/02_data/articles.xsl2
-rw-r--r--source/02_data/pages.xsl2
-rw-r--r--source/99_result/main.css89
-rw-r--r--source/99_result/stream.xsl1
-rw-r--r--utility/formatter.xsl20
-rw-r--r--utility/helper.xsl36
7 files changed, 148 insertions, 28 deletions
diff --git a/generate.xsl b/generate.xsl
index be7d7a3..bac0288 100644
--- a/generate.xsl
+++ b/generate.xsl
@@ -8,6 +8,8 @@
exclude-result-prefixes="dyn xalan InputXSLT"
>
+<xsl:import href="utility/helper.xsl"/>
+
<xsl:output
method="xml"
omit-xml-declaration="yes"
@@ -167,12 +169,20 @@
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
- <xsl:if test="./extension = '.xsl'">
- <xsl:call-template name="process">
- <xsl:with-param name="file" select="."/>
- <xsl:with-param name="target" select="concat($target, '/', $path)"/>
- </xsl:call-template>
- </xsl:if>
+ <xsl:choose>
+ <xsl:when test="./extension = '.xsl'">
+ <xsl:call-template name="process">
+ <xsl:with-param name="file" select="."/>
+ <xsl:with-param name="target" select="concat($target, '/', $path)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="./extension = '.css'">
+ <xsl:call-template name="linker">
+ <xsl:with-param name="from" select="./full"/>
+ <xsl:with-param name="to" select="concat($target, '/', $path, '/', ./name, ./extension)"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
@@ -182,6 +192,10 @@
<xsl:variable name="source">source</xsl:variable>
<xsl:variable name="target">target</xsl:variable>
+ <xsl:call-template name="cleaner">
+ <xsl:with-param name="path" select="$target"/>
+ </xsl:call-template>
+
<xsl:call-template name="traverse">
<xsl:with-param name="source" select="$source"/>
<xsl:with-param name="target" select="$target"/>
diff --git a/source/02_data/articles.xsl b/source/02_data/articles.xsl
index 642f417..7b951df 100644
--- a/source/02_data/articles.xsl
+++ b/source/02_data/articles.xsl
@@ -7,8 +7,8 @@
exclude-result-prefixes="xalan InputXSLT"
>
+<xsl:include href="[utility/helper.xsl]"/>
<xsl:include href="[utility/datasource.xsl]"/>
-<xsl:include href="[utility/formatter.xsl]"/>
<xsl:variable name="meta">
<datasource type="main" mode="full" source="target/01_files/source.xml" target="files"/>
diff --git a/source/02_data/pages.xsl b/source/02_data/pages.xsl
index 201c575..30a14f8 100644
--- a/source/02_data/pages.xsl
+++ b/source/02_data/pages.xsl
@@ -7,8 +7,8 @@
exclude-result-prefixes="xalan InputXSLT"
>
+<xsl:include href="[utility/helper.xsl]"/>
<xsl:include href="[utility/datasource.xsl]"/>
-<xsl:include href="[utility/formatter.xsl]"/>
<xsl:variable name="meta">
<datasource type="main" mode="full" source="target/01_files/source.xml" target="files"/>
diff --git a/source/99_result/main.css b/source/99_result/main.css
new file mode 100644
index 0000000..e4304b1
--- /dev/null
+++ b/source/99_result/main.css
@@ -0,0 +1,89 @@
+body{margin:0; padding:0; font:1em Droid Sans,sans-serif,Verdana,Arial,FreeSans; color:#272828; word-wrap:break-word}
+p{margin:0;line-height:1.5em}
+ul{margin:0; padding:0; list-style:none}
+ul li{float:left; padding:0 0.2em}
+ul li.last_item{padding-right:0}
+ul li a{text-decoration:none; color:#272828; background:#e3e8e8; border-radius:0.3em; padding:0.2em}
+ul li a:hover{text-decoration:underline}
+blockquote{border-left:0.4em solid #e3e8e8; margin-left:0; padding-left:1em}
+pre{padding:1em;border-radius:0.75em;color:#f8f8f2;background:#272822}
+#wrapper{width:870px; margin:2em auto; background:url(media/top.png) no-repeat top center,url(media/bottom.png) no-repeat bottom center,url(media/single.png) repeat top center}
+#content{width:720px; margin:0 auto; padding-top:70px; padding-bottom:70px}
+#nav_wrap{overflow:hidden; border-bottom:0.3em solid #e3e8e8; padding-bottom:0.1em}
+#nav_wrap ul{float:right; padding:0.4em 0}
+#nav_wrap h1{color:#F80; font-size:1.2em; font-weight:normal; float:left; padding:0.2em; padding-left:0; margin:0}
+#main{overflow:hidden}
+#main .article{border-bottom:0.3em dotted #e3e8e8; padding-bottom:0.5em; margin-top:1em; text-align:justify}
+#main .last{border:0}
+#main h2{font-size:1.4em; margin:0; color:#F80}
+#main h2 a{font-size:0.8em; text-decoration:none !important; color:#272828; font-weight:normal; display:inline-block; vertical-align:middle; max-width:95%}
+#main h2 a:hover{text-decoration:underline !important}
+#main h3{font-size:1.05em; font-weight:normal; margin-bottom:0.5em; border-bottom:0.1em solid #e3e8e8}
+#main .article p{margin-bottom:0.7em}
+#main .article a{text-decoration:underline; color:#272828}
+#main .article a:hover{color:black}
+#main .article ul{float:none; margin-left:2em; text-align:left;}
+#main .article ul li{list-style-type:circle; float:none}
+#main .article ul li a{background:none}
+#main .article .info{font-size:0.8em; margin-bottom:0.5em; margin-left:1.5em}
+#main .article .info a{text-decoration:none; color:#272828; margin:0 0.1em 0 0.1em}
+#main .article .info a:hover{text-decoration:underline}
+#main .article table {border-collapse:collapse;border-left:0.4em solid #e3e8e8; margin:1em}
+#main .article table thead {border-bottom:0.1em solid #272828}
+#main .article table tr {border-bottom:0.1em solid #272828}
+#main .article table tr:last-child {border-bottom:none}
+#main .article table tr th{font-weight:normal;padding:0.2em 1em}
+#main .article table tr td{padding:0.2em 1em}
+#main a img{padding:0.2em; border:0.1em solid #e3e8e8; display:block; margin-left:auto; margin-right:auto}
+#main a img.clear{border:none}
+#pagination{height:1.5em; margin-top:0.5em}
+#pagination span.disabled{display:none}
+#pagination span a{text-decoration:none; color:#272828}
+#pagination span a:hover{text-decoration:underline}
+#pagination span a.pagination-previous{float:left}
+#pagination span a.pagination-next{float:right}
+#footer_wrap{overflow:hidden; border-top:0.3em solid #e3e8e8}
+#last_line{ border-top:0.3em solid #e3e8e8; height:1.5em; padding-top:0.3em}
+#last_line a{text-decoration:none; color:#272828}
+#last_line a:hover{text-decoration:underline}
+#last_line ul{margin-top:-0.2em; float:right; padding:0.4em 0}
+.archiv {margin-top:1em}
+.columns {column-count:2;-moz-column-count:2;-webkit-column-count:2;column-gap:0;-moz-column-gap:0;-webkit-column-gap:0}
+.columns a {color:#272828; text-decoration:none}
+.columns a:hover {text-decoration:underline}
+.columns .column {display:inline-block}
+.taglist ul{padding:0.2em; float:none; overflow:hidden}
+.taglist ul li{margin:0.2em 0 0.2em 0; padding:0.2em}
+.articlelist ol{margin:0; padding:0.3em; list-style:none}
+.articlelist ol li{background:#e3e8e8; border-radius:0.3em; margin:0.2em; padding:0.2em}
+.articlelist ol li a{color:#272828; text-decoration:none}
+.articlelist ol li a:hover{text-decoration:underline}
+.archivlist ol{margin-top:0.2em; border-top:0.1em solid #e3e8e8}
+.archivlist ol li{background:none; padding-left:1em; font-size:0.8em}
+.archivlist ol li.dateitem{padding:0; font-weight:bold}
+.archivtag ul{margin-top:0.2em; border-top:0.1em solid #e3e8e8}
+.archivtag div{overflow:hidden; margin-bottom:0.5em}
+.prettylist li {float:none; overflow:hidden}
+.prettylist li a{background:none}
+.prettylist li em{font-style:normal; font-size:1.4em; color:#F80}
+.commentlist ol{margin-top:0.2em; border-top:0.1em solid #e3e8e8}
+.commentlist ol li{background:none; font-size:0.8em}
+.commentlist ol li.dateitem{padding:0; font-weight:bold}
+.project{border-bottom:0.2em dotted #e3e8e8; padding-top:0.5em; padding-bottom:0.5em; overflow:hidden}
+.project img{background:#e3e8e8; border-radius:0.3em; padding:0.2em; margin-right:1em; width:200px; height:150px}
+.lpos{float:left}
+.rpos{float:right}
+.mpos{margin:0 auto; display:block}
+
+@media screen and (max-width:870px){
+ #wrapper{width:100%; margin:0; background:none}
+ #content{margin:0 auto; padding:0}
+}
+
+@media screen and (max-width:725px){
+ #content{width:98%}
+ img.full{width:98%}
+ #main .article h2 a{max-width:90%}
+ .columns {column-count:1;-moz-column-count:1;-webkit-column-count:1}
+ .columns .column {width:100%}
+}
diff --git a/source/99_result/stream.xsl b/source/99_result/stream.xsl
index 526b8db..355314c 100644
--- a/source/99_result/stream.xsl
+++ b/source/99_result/stream.xsl
@@ -47,6 +47,7 @@
<a href="{$url}/tag/{.}">
<xsl:value-of select="."/>
</a>
+ <xsl:text> </xsl:text>
</xsl:for-each>
<xsl:text> | Adrian Kummerländer</xsl:text>
</p>
diff --git a/utility/formatter.xsl b/utility/formatter.xsl
deleted file mode 100644
index 1c2ff3f..0000000
--- a/utility/formatter.xsl
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xsl:stylesheet
- version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xalan="http://xml.apache.org/xalan"
- xmlns:InputXSLT="function.inputxslt.application"
- exclude-result-prefixes="xalan InputXSLT"
->
-
-<xsl:template name="formatter">
- <xsl:param name="format"/>
- <xsl:param name="source"/>
-
- <xsl:copy-of select="InputXSLT:external-command(
- $format,
- $source
- )/self::output/node()"/>
-</xsl:template>
-
-</xsl:stylesheet>
diff --git a/utility/helper.xsl b/utility/helper.xsl
new file mode 100644
index 0000000..cf3d7ba
--- /dev/null
+++ b/utility/helper.xsl
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
+ version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xalan="http://xml.apache.org/xalan"
+ xmlns:InputXSLT="function.inputxslt.application"
+ exclude-result-prefixes="xalan InputXSLT"
+>
+
+<xsl:template name="formatter">
+ <xsl:param name="format"/>
+ <xsl:param name="source"/>
+
+ <xsl:copy-of select="InputXSLT:external-command(
+ $format,
+ $source
+ )/self::command/node()"/>
+</xsl:template>
+
+<xsl:template name="cleaner">
+ <xsl:param name="path"/>
+
+ <cleaning path="./{$path}" result="{InputXSLT:external-command(
+ concat('rm -r ./', $path, '/*')
+ )/self::command/@result}"/>
+</xsl:template>
+
+<xsl:template name="linker">
+ <xsl:param name="from"/>
+ <xsl:param name="to"/>
+
+ <linkage from="{$from}" to="{$to}" result="{InputXSLT:external-command(
+ concat('ln -s ', $from, ' ./', $to)
+ )/self::command/@result}"/>
+</xsl:template>
+</xsl:stylesheet>