Permalink
Browse files

Added templer

  • Loading branch information...
1 parent 3008933 commit b60577df6e2a0268895093563ec7db977cc5448a @skx committed Dec 30, 2012
View
3 .gitignore
@@ -1,5 +1,8 @@
poole/*.pyc
pool/output/*
+
nanoc/tmp
nanoc/output/*
+
+templer/output/*
View
7 README.md
@@ -59,6 +59,7 @@ Available Tools
* [nanoc](#nanoc]
* pelican
* [poole](#poole)
+* [templer](#templer)
* tahchee
* webby
* webgen
@@ -93,6 +94,12 @@ Unfortunately poole fails to meet the requirements for two reasons:
* The tool is broken with regard to symlinks, as the sample project demonstrates.
+Templer
+-------
+
+[Templer](https://github.com/skx/templer) is my home-made solution, and satisfies my requirements. It is included for completeness only.
+
+
Links
-----
View
7 templer/Makefile
@@ -0,0 +1,7 @@
+
+build:
+ templer
+
+clean:
+ rm -rf ./output || true
+
View
5 templer/input/about.wgn
@@ -0,0 +1,5 @@
+title: About my site
+layout: alternative.layout
+----
+<p>This is my about page.</p>
+<p>The layout is different to the <a href="index.html">index page</a>.</p>
View
8 templer/input/index.wgn
@@ -0,0 +1,8 @@
+title: Welcome!
+location: Edinburgh
+----
+<p>Welcome to my site. We too have per-page variables:</p>
+<pre>
+I am in <!-- tmpl_var name='location' escape='html' -->
+</pre>
+<p>If you look at the <a href="about.html">about page</a> you'll see a different layout.</p>
View
1 templer/input/jquery
View
9,472 templer/input/jquery-1.8.3/jquery-1.8.3.js
9,472 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
1 templer/input/jquery-1.8.3/jquery.js
View
25 templer/layouts/alternative.layout
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+ <head>
+ <!-- tmpl_if name='title' -->
+ <title><!-- tmpl_var name='title' escape='html' --></title>
+ <!-- tmpl_else -->
+ <title>Untitled Page</title>
+ <!-- /tmpl_if -->
+ </head>
+ <body>
+ <table width="100%">
+ <tr>
+ <td valign="top" width="20%">
+ <ul>
+ <li>Free Software.</li>
+ <li>Cake.</li>
+ </ul>
+ </td>
+ <td valign="top">
+ <!-- tmpl_var name='content' -->
+ </td></tr>
+ </table>
+ </body>
+</html>
View
14 templer/layouts/default.layout
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+ <head>
+ <!-- tmpl_if name='title' -->
+ <title><!-- tmpl_var name='title' escape='html' --></title>
+ <!-- tmpl_else -->
+ <title>Untitled Page</title>
+ <!-- /tmpl_if -->
+ </head>
+ <body>
+ <!-- tmpl_var name='content' -->
+ </body>
+</html>
View
95 templer/templer.cfg
@@ -0,0 +1,95 @@
+##
+#
+# The first section of the configuration file refers to the
+# input and output paths.
+#
+# Templer will process all files matching "*.wgn" beneath a
+# particular directory. That directory is the input directory.
+#
+input = ./input/
+#
+##
+
+
+
+##
+#
+# Within the input directory we'll process files that match
+# a given suffix.
+#
+# By default this is ".wgn", so we'll template-expand files
+# named "index.wgn", "about.wgn", etc.
+#
+suffix = .wgn
+#
+##
+
+
+
+##
+#
+# If we're working in-place then files will be expanded where
+# they are found.
+#
+# This means that the following files will be created:
+#
+# ./input/index.wgn -> input/index.html
+# ./input/foo/index.wgn -> input/foo/index.html
+# ..
+#
+#
+# in-place = 1
+#
+##
+
+
+
+##
+#
+# The more common way of working is to produce the output in a separate
+# directory.
+#
+# NOTE: If you specify both "in-place=1" and an output directory the former
+# will take precedence.
+#
+#
+output = ./output/
+#
+##
+
+
+
+##
+#
+# When pages are processed a layout-template will be used to expand the content
+# into.
+#
+# Each page may specify its own layout if it so wishes, but generally we'd
+# expect only one layout to exist.
+#
+# Here we specify both the path to the layout directory and the layout to use
+# if none is specified:
+#
+#
+layout-path = ./layouts/
+layout = default.layout
+#
+##
+
+
+
+
+#
+# Anything below this is a global variable, accessible by name in your
+# templates.
+#
+# For example this:
+#
+# copyright = &copy; Steve Kemp 2012
+#
+# Can be used in your template, or you page text via:
+#
+# <!-- tmpl_var name='copyright' -->
+#
+#
+##

0 comments on commit b60577d

Please sign in to comment.