c5b1d198529921592aec73a25125df9cd34e807e
[cmless] / bin / template.py
# (c) 2017 Aaron Taylor <ataylor at subgeniuskitty dot com>
# See LICENSE file for copyright and license details.
# Python imports
import os
# CMless imports
import config, misc
def tpl_title(template):
keyword = "page_title"
return template.replace(config.template_delimiter + keyword +
config.template_delimiter, os.environ['REQUEST_URI'])
def tpl_body(template):
keyword = "page_content"
body = misc.load_file(config.site_data_prefix + os.environ['REQUEST_URI'] +
config.markup_file_extension)
body = misc.process_markup(body)
return template.replace(config.template_delimiter + keyword +
config.template_delimiter, body)