diff options
-rw-r--r-- | generate.xsl | 2 | ||||
-rw-r--r-- | template/compiler/pages.xsl | 10 | ||||
-rw-r--r-- | template/output/master.xsl | 18 | ||||
-rw-r--r-- | utility/context.xsl | 2 |
4 files changed, 20 insertions, 12 deletions
diff --git a/generate.xsl b/generate.xsl index e0e8121..04a9c2f 100644 --- a/generate.xsl +++ b/generate.xsl @@ -17,6 +17,8 @@ <xsl:include href="utility/context.xsl"/> <xsl:include href="utility/reader.xsl"/> +<xsl:variable name="context" select="meta"/> + <xsl:template name="generate_datasource"> <xsl:param name="source"/> <xsl:param name="transformation"/> diff --git a/template/compiler/pages.xsl b/template/compiler/pages.xsl index f4ada83..dbde8c9 100644 --- a/template/compiler/pages.xsl +++ b/template/compiler/pages.xsl @@ -14,12 +14,20 @@ indent="yes" /> +<xsl:include href="utility/context.xsl"/> + +<xsl:variable name="context" select="/data/meta"/> + <xsl:variable name="datasources"> <file name="pages.xml"/> </xsl:variable> <xsl:template match="datasource[@name = 'pages.xml']/entry"> - <compile>Compile page: <xsl:value-of select="@handle"/></compile> + <xsl:call-template name="generate_in_context"> + <xsl:with-param name="input" select="."/> + <xsl:with-param name="transformation" select="string('[template/output/page.xsl]')"/> + <xsl:with-param name="target" select="concat($context/target/output, '/pages/', @handle)"/> + </xsl:call-template> </xsl:template> </xsl:stylesheet> diff --git a/template/output/master.xsl b/template/output/master.xsl index e2b77b4..fa00f9e 100644 --- a/template/output/master.xsl +++ b/template/output/master.xsl @@ -25,7 +25,7 @@ <meta name="viewport" content="width=device-width,initial-scale=1.0"/> <title><xsl:call-template name="title-text"/></title> - <link rel="stylesheet" type="text/css" href="{/meta/target/url}/main.css" /> + <link rel="stylesheet" type="text/css" href="{/meta/target/public}/main.css" /> <link rel="shortcut icon" type="image/x-icon" href="favicon.ico" /> </head> @@ -33,13 +33,13 @@ <div id="wrapper"> <div id="content"> <div id="nav_wrap"> - <h1><xsl:value-of select="meta/title"/></h1> + <h1><xsl:value-of select="/meta/title"/></h1> <ul> - <li><a href="{/meta/target/url}">Start</a></li> - <li><a href="{/meta/target/url}/archiv">Archiv</a></li> - <li><a href="{/meta/target/url}/projekte">Projekte</a></li> - <li><a href="{/meta/target/url}/seiten/kontakt">Kontakt</a></li> - <li class="last_item"><a href="{/meta/target/url}/rss">RSS</a></li> + <li><a href="{/meta/target/public}">Start</a></li> + <li><a href="{/meta/target/public}/archiv">Archiv</a></li> + <li><a href="{/meta/target/public}/projekte">Projekte</a></li> + <li><a href="{/meta/target/public}/seiten/kontakt">Kontakt</a></li> + <li class="last_item"><a href="{/meta/target/public}/rss">RSS</a></li> </ul> </div> <div id="main"> @@ -50,8 +50,8 @@ <div id="last_line"> <a href="https://github.com/KnairdA/InputXSLT">Gemacht mit XSLT</a> <ul> - <li><a href="{/meta/target/url}/seiten/kontakt">Kontakt</a></li> - <li class="last_item"><a href="{/meta/target/url}/rss">RSS</a></li> + <li><a href="{/meta/target/public}/seiten/kontakt">Kontakt</a></li> + <li class="last_item"><a href="{/meta/target/public}/rss">RSS</a></li> </ul> </div> </div> diff --git a/utility/context.xsl b/utility/context.xsl index 87447bf..9dbfdc9 100644 --- a/utility/context.xsl +++ b/utility/context.xsl @@ -10,8 +10,6 @@ <xsl:include href="generator.xsl"/> <xsl:include href="transformer.xsl"/> -<xsl:variable name="context" select="meta"/> - <xsl:template name="transform_in_context"> <xsl:param name="input"/> <xsl:param name="transformation"/> |