From 732fe30756e54f59d2bcce6b0810f6965bea452b Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Sun, 7 Feb 2016 07:03:04 -0800 Subject: [PATCH] Add templates as their own module --- src/templates/all.nim | 7 +++++++ src/twtxtlist.nim | 10 +--------- 2 files changed, 8 insertions(+), 9 deletions(-) create mode 100644 src/templates/all.nim diff --git a/src/templates/all.nim b/src/templates/all.nim new file mode 100644 index 0000000..717767b --- /dev/null +++ b/src/templates/all.nim @@ -0,0 +1,7 @@ +const + baseTemplate*: string = staticRead "./templates/layout.mustache" + errorTemplate*: string = staticRead "./templates/error.mustache" + indexTemplate*: string = staticRead "./templates/index.mustache" + usersTemplate*: string = staticRead "./templates/users.mustache" + tweetsTemplate*: string = staticRead "./templates/tweets.mustache" + submitTemplate*: string = staticRead "./templates/submit.mustache" diff --git a/src/twtxtlist.nim b/src/twtxtlist.nim index e7927f7..81bed3b 100644 --- a/src/twtxtlist.nim +++ b/src/twtxtlist.nim @@ -1,13 +1,5 @@ import asyncdispatch, db_sqlite, httpclient, jester, moustachu, os, shorturl, - strutils, tables, times, twtxt, typetraits - -const - baseTemplate*: string = staticRead "./templates/layout.mustache" - errorTemplate*: string = staticRead "./templates/error.mustache" - indexTemplate*: string = staticRead "./templates/index.mustache" - usersTemplate*: string = staticRead "./templates/users.mustache" - tweetsTemplate*: string = staticRead "./templates/tweets.mustache" - submitTemplate*: string = staticRead "./templates/submit.mustache" + strutils, tables, templates/all, times, twtxt, typetraits let db = open("data/twtxt.db", nil, nil, nil)