From 1e7decfcda6029d3dfe8032e85d9e20f728d3dbd Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Wed, 18 Feb 2009 20:00:54 +0100 Subject: Use StringTemplate for web page generation. --- cljssss-g.clj | 15 +++++++-------- index.st | 21 +++++++++++++++++++++ 2 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 index.st diff --git a/cljssss-g.clj b/cljssss-g.clj index 6987a56..f5c4775 100644 --- a/cljssss-g.clj +++ b/cljssss-g.clj @@ -1,17 +1,16 @@ (ns cljssss-g - (require [net.cgrand.enlive-html :as enlive] - [clojure.xml :as xml] + (require [clojure.xml :as xml] compojure) + (import (org.antlr.stringtemplate StringTemplateGroup)) (use compojure)) +(def tgroup (new StringTemplateGroup "")) + (defservlet cljssss-g (GET "/" - (html [:html - [:head - [:title "Gödel-Gentzen Clojure Syndication Services Super System"]] - [:body - [:h1 "Gödel-Gentzen Clojure Syndication Services Super System"] - [:p "Fnord."]]])) + (.toString + (doto (.getInstanceOf tgroup "index") + (.setAttributes {"title" "Subscriptions"})))) (ANY "*" (page-not-found))) diff --git a/index.st b/index.st new file mode 100644 index 0000000..e41e9b5 --- /dev/null +++ b/index.st @@ -0,0 +1,21 @@ + + + + + + $title$ — Gödel-Gentzen Clojure Syndication Services Super System + + + +

$title$

+

$mainParagraph$

+ + + + -- cgit v1.2.3