/template/render/

This commit is contained in:
Martijn Voncken 2008-07-22 18:11:49 +00:00
parent f42f93d034
commit c5be051136
1 changed files with 16 additions and 6 deletions

View File

@ -390,12 +390,15 @@ class template_static(static_handler):
'templates/%s/static' % config.get('template')) 'templates/%s/static' % config.get('template'))
route("/template/static/(.*)", template_static) route("/template/static/(.*)", template_static)
class robots: class render_static:
def GET(self): "render anything in template_dir"
"no robots/prevent searchengines from indexing" @deco.deluge_page
web.header("Content-Type", "text/plain") def GET(self, name):
print "User-agent: *\nDisallow:/\n" filename = os.path.join(os.path.dirname(__file__),
route("/robots.txt", robots) 'templates/%s/static/%s' % (config.get('template'), name))
log.debug("render-static:%s" % filename)
return web.template.Template(open(filename).read(), filename=filename)()
route("/template/render/(.*)", render_static)
class template_style: class template_style:
def GET(self): def GET(self):
@ -404,6 +407,13 @@ class template_style:
print render.template_style(style) print render.template_style(style)
route("/template_style.css", template_style) route("/template_style.css", template_style)
class robots:
def GET(self):
"no robots/prevent searchengines from indexing"
web.header("Content-Type", "text/plain")
print "User-agent: *\nDisallow:/\n"
route("/robots.txt", robots)
class pixmaps: class pixmaps:
"use the deluge-images. located in data/pixmaps" "use the deluge-images. located in data/pixmaps"
def GET(self, name): def GET(self, name):